From 9b61350dbf5fed9f807a87222d7373a146c9b655 Mon Sep 17 00:00:00 2001 From: Yunusov_Niyaz Date: Wed, 22 Nov 2023 21:14:32 +0400 Subject: [PATCH 1/2] Lab6 --- .../Trolleybus/BusesGenericCollection.cs | 2 +- Trolleybus/Trolleybus/BusesGenericStorage.cs | 97 ++++++++++++++ Trolleybus/Trolleybus/ExtentionDrawingBus.cs | 49 +++++++ .../Trolleybus/FormBusCollection.Designer.cs | 123 ++++++++++++++---- Trolleybus/Trolleybus/FormBusCollection.cs | 40 +++++- Trolleybus/Trolleybus/FormBusCollection.resx | 9 ++ 6 files changed, 292 insertions(+), 28 deletions(-) create mode 100644 Trolleybus/Trolleybus/ExtentionDrawingBus.cs diff --git a/Trolleybus/Trolleybus/BusesGenericCollection.cs b/Trolleybus/Trolleybus/BusesGenericCollection.cs index f438fd7..9fbd6f1 100644 --- a/Trolleybus/Trolleybus/BusesGenericCollection.cs +++ b/Trolleybus/Trolleybus/BusesGenericCollection.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using ProjectTrolleybus.DrawingObjects; -using ProjectTrolleybus.Generics; namespace ProjectTrolleybus.Generics { @@ -130,5 +129,6 @@ namespace ProjectTrolleybus.Generics i++; } } + public IEnumerable GetBuses => _collection.GetBuses(); } } \ No newline at end of file diff --git a/Trolleybus/Trolleybus/BusesGenericStorage.cs b/Trolleybus/Trolleybus/BusesGenericStorage.cs index 4ebcbb5..0bf3508 100644 --- a/Trolleybus/Trolleybus/BusesGenericStorage.cs +++ b/Trolleybus/Trolleybus/BusesGenericStorage.cs @@ -27,6 +27,19 @@ namespace ProjectTrolleybus.Generics /// Высота окна отрисовки /// private readonly int _pictureHeight; + /// + /// Разделитель для записи ключа и значения элемента словаря + /// + private static readonly char _separatorForKeyValue = '|'; + /// + /// Разделитель для записей коллекции данных в файл + /// + private readonly char _separatorRecords = ';'; + /// + /// Разделитель для записи информации по объекту в файл + /// + private static readonly char _separatorForObject = ':'; + /// /// Конструктор /// @@ -73,5 +86,89 @@ namespace ProjectTrolleybus.Generics return null; } } + /// + /// Сохранение информации по автомобилям в хранилище в файл + /// + /// Путь и имя файла + /// true - сохранение прошло успешно, false - ошибка при сохранении данных + public bool SaveData(string filename) + { + if (File.Exists(filename)) + { + File.Delete(filename); + } + StringBuilder data = new(); + foreach (KeyValuePair> record in _busStorages) + { + StringBuilder records = new(); + foreach (DrawingBus? elem in record.Value.GetBuses) + { + records.Append($"{elem?.GetDataForSave(_separatorForObject)}{_separatorRecords}"); + } + data.AppendLine($"{record.Key}{_separatorForKeyValue}{records}"); + } + if (data.Length == 0) + { + return false; + } + using (StreamWriter streamWriter = new(filename)) + { + streamWriter.WriteLine($"BusStorages{Environment.NewLine}{data}"); + } + return true; + } + /// + /// Загрузка информации по автомобилям в хранилище из файла + /// + /// Путь и имя файла + /// true - загрузка прошла успешно, false - ошибка при загрузке данных + public bool LoadData(string filename) + { + if (!File.Exists(filename)) + { + return false; + } + using (StreamReader streanReader = new(filename)) + { + string str = streanReader.ReadLine(); + var strings = str.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); + if (strings == null || strings.Length == 0) + { + return false; + } + if (!strings[0].StartsWith("BusStorages")) + { + return false; + } + _busStorages.Clear(); + do + { + string[] record = str.Split(_separatorForKeyValue, StringSplitOptions.RemoveEmptyEntries); + if (record.Length != 2) + { + str = streanReader.ReadLine(); + continue; + } + BusesGenericCollection collection = new(_pictureWidth, _pictureHeight); + string[] set = record[1].Split(_separatorRecords, + StringSplitOptions.RemoveEmptyEntries); + foreach (string elem in set) + { + DrawingBus? bus = elem?.CreateDrawingBus(_separatorForObject, _pictureWidth, _pictureHeight); + if (bus != null) + { + if (!(collection + bus)) + { + return false; + } + } + } + _busStorages.Add(record[0], collection); + str = streanReader.ReadLine(); + } while (str != null); + } + return true; + } } } diff --git a/Trolleybus/Trolleybus/ExtentionDrawingBus.cs b/Trolleybus/Trolleybus/ExtentionDrawingBus.cs new file mode 100644 index 0000000..6d0fd60 --- /dev/null +++ b/Trolleybus/Trolleybus/ExtentionDrawingBus.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ProjectTrolleybus.Entities; + +namespace ProjectTrolleybus.DrawingObjects +{ + public static class ExtentionDrawingBus + { + public static DrawingBus? CreateDrawingBus(this string info, char separatorForObject, int width, int height) + { + string[] strs = info.Split(separatorForObject); + if (strs.Length == 3) + { + return new DrawingBus(Convert.ToInt32(strs[0]), + Convert.ToInt32(strs[1]), Color.FromName(strs[2]), width, height); + } + if (strs.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]), + width, height); + } + return null; + } + public static string GetDataForSave(this DrawingBus drawingBus, char separatorForObject) + { + var bus = drawingBus.EntityBus; + if (bus == null) + { + return string.Empty; + } + var str = $"{bus.Speed}{separatorForObject}{bus.Weight}{separatorForObject}{bus.BodyColor.Name}"; + if (bus is not EntityTrolleybus trolleybus) + { + return str; + } + return $"{str}{separatorForObject}{trolleybus.AdditionalColor.Name}{separatorForObject}{trolleybus.Roga}{separatorForObject}{trolleybus.Battery}"; + } + } + +} + diff --git a/Trolleybus/Trolleybus/FormBusCollection.Designer.cs b/Trolleybus/Trolleybus/FormBusCollection.Designer.cs index 9366e27..39d4bf1 100644 --- a/Trolleybus/Trolleybus/FormBusCollection.Designer.cs +++ b/Trolleybus/Trolleybus/FormBusCollection.Designer.cs @@ -39,9 +39,16 @@ maskedTextBoxNumber = new MaskedTextBox(); buttonAddBus = new Button(); pictureBoxCollection = new PictureBox(); + menuStrip = new MenuStrip(); + файлToolStripMenuItem = new ToolStripMenuItem(); + SaveToolStripMenuItem = new ToolStripMenuItem(); + LoadToolStripMenuItem = new ToolStripMenuItem(); + openFileDialog = new OpenFileDialog(); + saveFileDialog = new SaveFileDialog(); groupBoxTrolleybus.SuspendLayout(); groupBoxSets.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pictureBoxCollection).BeginInit(); + menuStrip.SuspendLayout(); SuspendLayout(); // // groupBoxTrolleybus @@ -51,9 +58,11 @@ groupBoxTrolleybus.Controls.Add(buttonDeleteBus); groupBoxTrolleybus.Controls.Add(maskedTextBoxNumber); groupBoxTrolleybus.Controls.Add(buttonAddBus); - groupBoxTrolleybus.Location = new Point(538, 2); + groupBoxTrolleybus.Location = new Point(615, 32); + groupBoxTrolleybus.Margin = new Padding(3, 4, 3, 4); groupBoxTrolleybus.Name = "groupBoxTrolleybus"; - groupBoxTrolleybus.Size = new Size(262, 448); + groupBoxTrolleybus.Padding = new Padding(3, 4, 3, 4); + groupBoxTrolleybus.Size = new Size(299, 568); groupBoxTrolleybus.TabIndex = 0; groupBoxTrolleybus.TabStop = false; groupBoxTrolleybus.Text = "Инструменты"; @@ -65,25 +74,29 @@ groupBoxSets.Controls.Add(buttonDelObject); groupBoxSets.Controls.Add(listBoxStorages); groupBoxSets.Controls.Add(buttonAddObject); - groupBoxSets.Location = new Point(6, 22); + groupBoxSets.Location = new Point(11, 28); + groupBoxSets.Margin = new Padding(3, 4, 3, 4); groupBoxSets.Name = "groupBoxSets"; - groupBoxSets.Size = new Size(245, 234); + groupBoxSets.Padding = new Padding(3, 4, 3, 4); + groupBoxSets.Size = new Size(280, 312); groupBoxSets.TabIndex = 4; groupBoxSets.TabStop = false; groupBoxSets.Text = "Наборы"; // // textBoxStorageName // - textBoxStorageName.Location = new Point(6, 22); + textBoxStorageName.Location = new Point(7, 29); + textBoxStorageName.Margin = new Padding(3, 4, 3, 4); textBoxStorageName.Name = "textBoxStorageName"; - textBoxStorageName.Size = new Size(233, 23); + textBoxStorageName.Size = new Size(266, 27); textBoxStorageName.TabIndex = 4; // // buttonDelObject // - buttonDelObject.Location = new Point(6, 194); + buttonDelObject.Location = new Point(7, 259); + buttonDelObject.Margin = new Padding(3, 4, 3, 4); buttonDelObject.Name = "buttonDelObject"; - buttonDelObject.Size = new Size(233, 30); + buttonDelObject.Size = new Size(266, 40); buttonDelObject.TabIndex = 3; buttonDelObject.Text = "Удалить набор"; buttonDelObject.UseVisualStyleBackColor = true; @@ -92,19 +105,21 @@ // listBoxStorages // listBoxStorages.FormattingEnabled = true; - listBoxStorages.ItemHeight = 15; - listBoxStorages.Location = new Point(6, 94); + listBoxStorages.ItemHeight = 20; + listBoxStorages.Location = new Point(7, 125); + listBoxStorages.Margin = new Padding(3, 4, 3, 4); listBoxStorages.Name = "listBoxStorages"; - listBoxStorages.Size = new Size(233, 94); + listBoxStorages.Size = new Size(266, 124); listBoxStorages.TabIndex = 2; listBoxStorages.SelectedIndexChanged += ListBoxObjects_SelectedIndexChanged; // // buttonAddObject // buttonAddObject.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonAddObject.Location = new Point(6, 62); + buttonAddObject.Location = new Point(7, 83); + buttonAddObject.Margin = new Padding(3, 4, 3, 4); buttonAddObject.Name = "buttonAddObject"; - buttonAddObject.Size = new Size(233, 26); + buttonAddObject.Size = new Size(266, 35); buttonAddObject.TabIndex = 1; buttonAddObject.Text = "Добавить набор"; buttonAddObject.UseVisualStyleBackColor = true; @@ -112,9 +127,10 @@ // // buttonUpdateCollection // - buttonUpdateCollection.Location = new Point(10, 408); + buttonUpdateCollection.Location = new Point(11, 499); + buttonUpdateCollection.Margin = new Padding(3, 4, 3, 4); buttonUpdateCollection.Name = "buttonUpdateCollection"; - buttonUpdateCollection.Size = new Size(241, 28); + buttonUpdateCollection.Size = new Size(275, 37); buttonUpdateCollection.TabIndex = 3; buttonUpdateCollection.Text = "Обновить коллекцию"; buttonUpdateCollection.UseVisualStyleBackColor = true; @@ -122,9 +138,10 @@ // // buttonDeleteBus // - buttonDeleteBus.Location = new Point(10, 343); + buttonDeleteBus.Location = new Point(11, 439); + buttonDeleteBus.Margin = new Padding(3, 4, 3, 4); buttonDeleteBus.Name = "buttonDeleteBus"; - buttonDeleteBus.Size = new Size(241, 29); + buttonDeleteBus.Size = new Size(275, 39); buttonDeleteBus.TabIndex = 2; buttonDeleteBus.Text = "Удалить автобус"; buttonDeleteBus.UseVisualStyleBackColor = true; @@ -132,17 +149,19 @@ // // maskedTextBoxNumber // - maskedTextBoxNumber.Location = new Point(70, 305); + maskedTextBoxNumber.Location = new Point(74, 404); + maskedTextBoxNumber.Margin = new Padding(3, 4, 3, 4); maskedTextBoxNumber.Name = "maskedTextBoxNumber"; - maskedTextBoxNumber.Size = new Size(115, 23); + maskedTextBoxNumber.Size = new Size(131, 27); maskedTextBoxNumber.TabIndex = 1; // // buttonAddBus // buttonAddBus.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonAddBus.Location = new Point(10, 262); + buttonAddBus.Location = new Point(11, 348); + buttonAddBus.Margin = new Padding(3, 4, 3, 4); buttonAddBus.Name = "buttonAddBus"; - buttonAddBus.Size = new Size(241, 28); + buttonAddBus.Size = new Size(275, 37); buttonAddBus.TabIndex = 0; buttonAddBus.Text = "Добавить автобус"; buttonAddBus.UseVisualStyleBackColor = true; @@ -151,19 +170,64 @@ // pictureBoxCollection // pictureBoxCollection.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; - pictureBoxCollection.Location = new Point(0, 2); + pictureBoxCollection.Location = new Point(0, 32); + pictureBoxCollection.Margin = new Padding(3, 4, 3, 4); pictureBoxCollection.Name = "pictureBoxCollection"; - pictureBoxCollection.Size = new Size(537, 448); + pictureBoxCollection.Size = new Size(616, 568); pictureBoxCollection.TabIndex = 1; pictureBoxCollection.TabStop = false; // + // menuStrip + // + menuStrip.ImageScalingSize = new Size(20, 20); + menuStrip.Items.AddRange(new ToolStripItem[] { файлToolStripMenuItem }); + menuStrip.Location = new Point(0, 0); + menuStrip.Name = "menuStrip"; + menuStrip.Size = new Size(920, 28); + menuStrip.TabIndex = 2; + menuStrip.Text = "menuStrip1"; + // + // файлToolStripMenuItem + // + файлToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { SaveToolStripMenuItem, LoadToolStripMenuItem }); + файлToolStripMenuItem.Name = "файлToolStripMenuItem"; + файлToolStripMenuItem.Size = new Size(59, 24); + файлToolStripMenuItem.Text = "Файл"; + // + // SaveToolStripMenuItem + // + SaveToolStripMenuItem.Name = "SaveToolStripMenuItem"; + SaveToolStripMenuItem.Size = new Size(166, 26); + SaveToolStripMenuItem.Text = "Сохранить"; + SaveToolStripMenuItem.Click += SaveToolStripMenuItem_Click; + // + // LoadToolStripMenuItem + // + LoadToolStripMenuItem.Name = "LoadToolStripMenuItem"; + LoadToolStripMenuItem.Size = new Size(166, 26); + LoadToolStripMenuItem.Text = "Загрузить"; + LoadToolStripMenuItem.Click += LoadToolStripMenuItem_Click; + // + // openFileDialog + // + openFileDialog.FileName = "openFileDialog1"; + openFileDialog.Filter = "«txt file | *.txt"; + // + // saveFileDialog + // + saveFileDialog.FileName = "busStorages"; + saveFileDialog.Filter = "«txt file | *.txt"; + // // FormBusCollection // - AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(805, 450); + ClientSize = new Size(920, 600); Controls.Add(groupBoxTrolleybus); Controls.Add(pictureBoxCollection); + Controls.Add(menuStrip); + MainMenuStrip = menuStrip; + Margin = new Padding(3, 4, 3, 4); Name = "FormBusCollection"; StartPosition = FormStartPosition.CenterScreen; Text = "Набор автобусов"; @@ -172,7 +236,10 @@ groupBoxSets.ResumeLayout(false); groupBoxSets.PerformLayout(); ((System.ComponentModel.ISupportInitialize)pictureBoxCollection).EndInit(); + menuStrip.ResumeLayout(false); + menuStrip.PerformLayout(); ResumeLayout(false); + PerformLayout(); } #endregion @@ -188,5 +255,11 @@ private ListBox listBoxStorages; private Button buttonAddObject; private TextBox textBoxStorageName; + private MenuStrip menuStrip; + private ToolStripMenuItem файлToolStripMenuItem; + private ToolStripMenuItem SaveToolStripMenuItem; + private ToolStripMenuItem LoadToolStripMenuItem; + private OpenFileDialog openFileDialog; + private SaveFileDialog saveFileDialog; } } \ No newline at end of file diff --git a/Trolleybus/Trolleybus/FormBusCollection.cs b/Trolleybus/Trolleybus/FormBusCollection.cs index 5148483..9dad877 100644 --- a/Trolleybus/Trolleybus/FormBusCollection.cs +++ b/Trolleybus/Trolleybus/FormBusCollection.cs @@ -81,7 +81,8 @@ namespace ProjectTrolleybus } FormBusConfig form = new FormBusConfig(pictureBoxCollection.Width, pictureBoxCollection.Height); form.Show(); - Action? busDelegate = new((bus) => { + Action? busDelegate = new((bus) => + { if (obj + bus) { MessageBox.Show("Объект добавлен"); @@ -134,6 +135,41 @@ namespace ProjectTrolleybus } pictureBoxCollection.Image = obj.ShowBuses(); } - + private void SaveToolStripMenuItem_Click(object sender, EventArgs e) + { + if (saveFileDialog.ShowDialog() == DialogResult.OK) + { + if (_storage.SaveData(saveFileDialog.FileName)) + { + MessageBox.Show("Сохранение прошло успешно", + "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + MessageBox.Show("Не сохранилось", "Результат", + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + private void LoadToolStripMenuItem_Click(object sender, EventArgs e) + { + if (openFileDialog.ShowDialog() == DialogResult.OK) + { + if (_storage.LoadData(openFileDialog.FileName)) + { + MessageBox.Show("Загрузка прошла успешно", + "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information); + foreach (var collection in _storage.Keys) + { + listBoxStorages.Items.Add(collection); + } + } + else + { + MessageBox.Show("Не загрузилось", "Результат", + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } } } diff --git a/Trolleybus/Trolleybus/FormBusCollection.resx b/Trolleybus/Trolleybus/FormBusCollection.resx index af32865..e9660ab 100644 --- a/Trolleybus/Trolleybus/FormBusCollection.resx +++ b/Trolleybus/Trolleybus/FormBusCollection.resx @@ -117,4 +117,13 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 153, 17 + + + 315, 17 + \ No newline at end of file -- 2.25.1 From a96cb7156e19d4251d8aba4523b3b0244160c6f5 Mon Sep 17 00:00:00 2001 From: Yunusov_Niyaz Date: Wed, 6 Dec 2023 17:18:36 +0400 Subject: [PATCH 2/2] Lab6 Done+ --- Trolleybus/Trolleybus/BusesGenericStorage.cs | 18 ++++++--------- Trolleybus/Trolleybus/ExtentionDrawingBus.cs | 22 +++++++++---------- .../Trolleybus/FormBusCollection.Designer.cs | 2 +- 3 files changed, 19 insertions(+), 23 deletions(-) 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 -- 2.25.1