diff --git a/Trolleybus/Trolleybus/BusesGenericStorage.cs b/Trolleybus/Trolleybus/BusesGenericStorage.cs index 0bf3508..232012e 100644 --- a/Trolleybus/Trolleybus/BusesGenericStorage.cs +++ b/Trolleybus/Trolleybus/BusesGenericStorage.cs @@ -39,7 +39,6 @@ namespace ProjectTrolleybus.Generics /// Разделитель для записи информации по объекту в файл /// private static readonly char _separatorForObject = ':'; - /// /// Конструктор /// @@ -47,8 +46,7 @@ namespace ProjectTrolleybus.Generics /// public BusesGenericStorage(int pictureWidth, int pictureHeight) { - _busStorages = new Dictionary>(); + _busStorages = new Dictionary>(); _pictureWidth = pictureWidth; _pictureHeight = pictureHeight; } @@ -76,8 +74,7 @@ namespace ProjectTrolleybus.Generics /// /// /// - public BusesGenericCollection? - this[string ind] + public BusesGenericCollection? this[string ind] { get { @@ -129,9 +126,9 @@ namespace ProjectTrolleybus.Generics { return false; } - using (StreamReader streanReader = new(filename)) + using (StreamReader streamReader = new(filename)) { - string str = streanReader.ReadLine(); + string str = streamReader.ReadLine(); var strings = str.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); if (strings == null || strings.Length == 0) { @@ -147,12 +144,11 @@ namespace ProjectTrolleybus.Generics string[] record = str.Split(_separatorForKeyValue, StringSplitOptions.RemoveEmptyEntries); if (record.Length != 2) { - str = streanReader.ReadLine(); + str = streamReader.ReadLine(); continue; } BusesGenericCollection collection = new(_pictureWidth, _pictureHeight); - string[] set = record[1].Split(_separatorRecords, - StringSplitOptions.RemoveEmptyEntries); + string[] set = record[1].Split(_separatorRecords, StringSplitOptions.RemoveEmptyEntries); foreach (string elem in set) { DrawingBus? bus = elem?.CreateDrawingBus(_separatorForObject, _pictureWidth, _pictureHeight); @@ -165,7 +161,7 @@ namespace ProjectTrolleybus.Generics } } _busStorages.Add(record[0], collection); - str = streanReader.ReadLine(); + str = streamReader.ReadLine(); } while (str != null); } return true; diff --git a/Trolleybus/Trolleybus/ExtentionDrawingBus.cs b/Trolleybus/Trolleybus/ExtentionDrawingBus.cs index 6d0fd60..9521f9c 100644 --- a/Trolleybus/Trolleybus/ExtentionDrawingBus.cs +++ b/Trolleybus/Trolleybus/ExtentionDrawingBus.cs @@ -11,20 +11,20 @@ namespace ProjectTrolleybus.DrawingObjects { public static DrawingBus? CreateDrawingBus(this string info, char separatorForObject, int width, int height) { - string[] strs = info.Split(separatorForObject); - if (strs.Length == 3) + string[] strings = info.Split(separatorForObject); + if (strings.Length == 3) { - return new DrawingBus(Convert.ToInt32(strs[0]), - Convert.ToInt32(strs[1]), Color.FromName(strs[2]), width, height); + return new DrawingBus(Convert.ToInt32(strings[0]), + Convert.ToInt32(strings[1]), Color.FromName(strings[2]), width, height); } - if (strs.Length == 6) + if (strings.Length == 6) { - return new DrawingTrolleybus(Convert.ToInt32(strs[0]), - Convert.ToInt32(strs[1]), - Color.FromName(strs[2]), - Color.FromName(strs[3]), - Convert.ToBoolean(strs[4]), - Convert.ToBoolean(strs[5]), + return new DrawingTrolleybus(Convert.ToInt32(strings[0]), + Convert.ToInt32(strings[1]), + Color.FromName(strings[2]), + Color.FromName(strings[3]), + Convert.ToBoolean(strings[4]), + Convert.ToBoolean(strings[5]), width, height); } return null; diff --git a/Trolleybus/Trolleybus/FormBusCollection.Designer.cs b/Trolleybus/Trolleybus/FormBusCollection.Designer.cs index 39d4bf1..a18e5ce 100644 --- a/Trolleybus/Trolleybus/FormBusCollection.Designer.cs +++ b/Trolleybus/Trolleybus/FormBusCollection.Designer.cs @@ -210,7 +210,7 @@ // // openFileDialog // - openFileDialog.FileName = "openFileDialog1"; + openFileDialog.FileName = "busStorages"; openFileDialog.Filter = "«txt file | *.txt"; // // saveFileDialog