diff --git a/Trolleybus/Trolleybus/BusesCollectionInfo.cs b/Trolleybus/Trolleybus/BusesCollectionInfo.cs index a5b7eb3..a8ddeee 100644 --- a/Trolleybus/Trolleybus/BusesCollectionInfo.cs +++ b/Trolleybus/Trolleybus/BusesCollectionInfo.cs @@ -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() { diff --git a/Trolleybus/Trolleybus/BusesGenericCollection.cs b/Trolleybus/Trolleybus/BusesGenericCollection.cs index c28bb54..6f6f367 100644 --- a/Trolleybus/Trolleybus/BusesGenericCollection.cs +++ b/Trolleybus/Trolleybus/BusesGenericCollection.cs @@ -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; } /// diff --git a/Trolleybus/Trolleybus/DrawingBusEquality.cs b/Trolleybus/Trolleybus/DrawingBusEqutables.cs similarity index 96% rename from Trolleybus/Trolleybus/DrawingBusEquality.cs rename to Trolleybus/Trolleybus/DrawingBusEqutables.cs index 8085728..d256bba 100644 --- a/Trolleybus/Trolleybus/DrawingBusEquality.cs +++ b/Trolleybus/Trolleybus/DrawingBusEqutables.cs @@ -7,10 +7,9 @@ using ProjectTrolleybus.DrawingObjects; using ProjectTrolleybus.Entities; using System.Diagnostics.CodeAnalysis; - namespace ProjectTrolleybus { - internal class DrawingBusEquality : IEqualityComparer + internal class DrawingBusEqutables : IEqualityComparer { public bool Equals(DrawingBus? x, DrawingBus? y) { diff --git a/Trolleybus/Trolleybus/FormBusCollection.Designer.cs b/Trolleybus/Trolleybus/FormBusCollection.Designer.cs index db8c489..695fbb0 100644 --- a/Trolleybus/Trolleybus/FormBusCollection.Designer.cs +++ b/Trolleybus/Trolleybus/FormBusCollection.Designer.cs @@ -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; } } \ No newline at end of file