Lab8 pull

This commit is contained in:
Yunusov_Niyaz 2023-12-22 18:35:02 +04:00
parent f629e43cea
commit 405afb65a9
4 changed files with 27 additions and 29 deletions

View File

@ -17,10 +17,9 @@ namespace ProjectTrolleybus.Generics
}
public bool Equals(BusesCollectionInfo? other)
{
if (other == null)
return false;
return Name == other.Name;
throw new NotImplementedException();
if (Name == other?.Name)
return true;
return false;
}
public override int GetHashCode()
{

View File

@ -55,7 +55,7 @@ namespace ProjectTrolleybus.Generics
{
if (obj == null || collect == null)
return false;
collect?._collection.Insert(obj, new DrawingBusEquality());
collect?._collection.Insert(obj, new DrawingBusEqutables());
return true;
}
/// <summary>

View File

@ -7,10 +7,9 @@ using ProjectTrolleybus.DrawingObjects;
using ProjectTrolleybus.Entities;
using System.Diagnostics.CodeAnalysis;
namespace ProjectTrolleybus
{
internal class DrawingBusEquality : IEqualityComparer<DrawingBus?>
internal class DrawingBusEqutables : IEqualityComparer<DrawingBus?>
{
public bool Equals(DrawingBus? x, DrawingBus? y)
{

View File

@ -29,8 +29,8 @@
private void InitializeComponent()
{
groupBoxTrolleybus = new GroupBox();
ButtonSortByColor = new Button();
ButtonSortByType = new Button();
buttonSortByColor = new Button();
buttonSortByType = new Button();
groupBoxSets = new GroupBox();
textBoxStorageName = new TextBox();
buttonDelObject = new Button();
@ -55,8 +55,8 @@
//
// groupBoxTrolleybus
//
groupBoxTrolleybus.Controls.Add(ButtonSortByColor);
groupBoxTrolleybus.Controls.Add(ButtonSortByType);
groupBoxTrolleybus.Controls.Add(buttonSortByColor);
groupBoxTrolleybus.Controls.Add(buttonSortByType);
groupBoxTrolleybus.Controls.Add(groupBoxSets);
groupBoxTrolleybus.Controls.Add(buttonUpdateCollection);
groupBoxTrolleybus.Controls.Add(buttonDeleteBus);
@ -71,25 +71,25 @@
groupBoxTrolleybus.TabStop = false;
groupBoxTrolleybus.Text = "Инструменты";
//
// ButtonSortByColor
// buttonSortByColor
//
ButtonSortByColor.Location = new Point(11, 361);
ButtonSortByColor.Name = "ButtonSortByColor";
ButtonSortByColor.Size = new Size(273, 33);
ButtonSortByColor.TabIndex = 6;
ButtonSortByColor.Text = "Сортировка по цвету";
ButtonSortByColor.UseVisualStyleBackColor = true;
ButtonSortByColor.Click += ButtonSortByColor_Click;
buttonSortByColor.Location = new Point(11, 361);
buttonSortByColor.Name = "buttonSortByColor";
buttonSortByColor.Size = new Size(273, 33);
buttonSortByColor.TabIndex = 6;
buttonSortByColor.Text = "Сортировка по цвету";
buttonSortByColor.UseVisualStyleBackColor = true;
buttonSortByColor.Click += ButtonSortByColor_Click;
//
// ButtonSortByType
// buttonSortByType
//
ButtonSortByType.Location = new Point(11, 320);
ButtonSortByType.Name = "ButtonSortByType";
ButtonSortByType.Size = new Size(275, 35);
ButtonSortByType.TabIndex = 5;
ButtonSortByType.Text = "Сортировка по типу";
ButtonSortByType.UseVisualStyleBackColor = true;
ButtonSortByType.Click += ButtonSortByType_Click;
buttonSortByType.Location = new Point(11, 320);
buttonSortByType.Name = "buttonSortByType";
buttonSortByType.Size = new Size(275, 35);
buttonSortByType.TabIndex = 5;
buttonSortByType.Text = "Сортировка по типу";
buttonSortByType.UseVisualStyleBackColor = true;
buttonSortByType.Click += ButtonSortByType_Click;
//
// groupBoxSets
//
@ -285,7 +285,7 @@
private ToolStripMenuItem LoadToolStripMenuItem;
private OpenFileDialog openFileDialog;
private SaveFileDialog saveFileDialog;
private Button ButtonSortByColor;
private Button ButtonSortByType;
private Button buttonSortByColor;
private Button buttonSortByType;
}
}