diff --git a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/AbstractCompany.cs b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/AbstractCompany.cs
index d550c92..574b5dc 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/AbstractCompany.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/AbstractCompany.cs
@@ -41,7 +41,7 @@ public abstract class AbstractCompany
_pictureWidth = picWidth;
_pictureHeight = picHeight;
_collection = collection;
- _collection.SetMaxCount = GetMaxCount;
+ _collection.MaxCount = GetMaxCount;
}
///
/// Перегрузка оператора сложения для класса
diff --git a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/ICollectionGenericObjects.cs b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/ICollectionGenericObjects.cs
index 062c452..558d417 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/ICollectionGenericObjects.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/ICollectionGenericObjects.cs
@@ -13,7 +13,7 @@ public interface ICollectionGenericObjects
///
/// Установка максимального количества элементов
///
- int SetMaxCount { set; }
+ int MaxCount { get; set; }
///
/// Добавление объекта в коллекцию
///
@@ -39,4 +39,15 @@ public interface ICollectionGenericObjects
/// Позиция
/// Объект
T? Get(int position);
-}
+
+ ///
+ /// Получение типа коллекции
+ ///
+ CollectionType GetCollectionType { get; }
+
+ ///
+ /// Получение объектов коллекции по одному
+ ///
+ /// Поэлементый вывод элементов коллекции
+ IEnumerable GetItems();
+}
\ No newline at end of file
diff --git a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/ListGenericObjects.cs b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/ListGenericObjects.cs
index 3d3aada..d3ed1da 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/ListGenericObjects.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/ListGenericObjects.cs
@@ -15,7 +15,11 @@ public class ListGenericObjects : ICollectionGenericObjects
public int Count => _collection.Count;
- public int SetMaxCount {
+ public int MaxCount {
+ get
+ {
+ return _collection.Count;
+ }
set
{
if (value > 0)
@@ -24,6 +28,8 @@ public class ListGenericObjects : ICollectionGenericObjects
}
}
}
+
+ public CollectionType GetCollectionType => CollectionType.List;
///
/// Конструктор
///
@@ -59,4 +65,12 @@ public class ListGenericObjects : ICollectionGenericObjects
_collection.RemoveAt(position);
return temp;
}
+
+ public IEnumerable GetItems()
+ {
+ for (int i = 0; i < _collection.Count; ++i)
+ {
+ yield return _collection[i];
+ }
+ }
}
diff --git a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/MassiveGenericObjects.cs b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/MassiveGenericObjects.cs
index a733aa5..e393956 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/MassiveGenericObjects.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/MassiveGenericObjects.cs
@@ -11,8 +11,12 @@ public class MassiveGenericObjects : ICollectionGenericObjects
///
private T?[] _collection;
public int Count => _collection.Length;
- public int SetMaxCount
+ public int MaxCount
{
+ get
+ {
+ return _collection.Length;
+ }
set
{
if (value > 0)
@@ -28,6 +32,8 @@ public class MassiveGenericObjects : ICollectionGenericObjects
}
}
}
+
+ public CollectionType GetCollectionType => CollectionType.Massive;
///
/// Конструктор
///
@@ -89,4 +95,12 @@ public class MassiveGenericObjects : ICollectionGenericObjects
_collection[position] = null;
return myObject;
}
-}
+
+ public IEnumerable GetItems()
+ {
+ for (int i = 0; i < _collection.Length; ++i)
+ {
+ yield return _collection[i];
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/StorageCollection.cs b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/StorageCollection.cs
index 2e0da01..39a8d09 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/StorageCollection.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/CollectionGenericObjects/StorageCollection.cs
@@ -1,17 +1,36 @@
-namespace ProjectCleaningCar.CollectionGenericObjects;
+using ProjectCleaningCar.Drawning;
+using ProjectCleaningCar.Entities;
+using System.Text;
+
+namespace ProjectCleaningCar.CollectionGenericObjects;
///
/// Класс-хранилище коллекций
///
///
public class StorageCollection
- where T : class
+ where T : DrawningTruck
{
///
/// Словарь (хранилище) с коллекциями
///
readonly Dictionary> _storages;
-
+
+ ///
+ /// Ключевое слово, с которого должен начинаться файл
+ ///
+ private readonly string _collectionKey = "CollectionsStorage";
+
+ ///
+ /// Разделитель для записей коллекции данных в файл
+ ///
+ private readonly string _separatorItems = ";";
+
+ ///
+ /// Разделитель для записи ключа и значения элемента словаря
+ ///
+ private readonly string _separatorForKeyValue = "|";
+
///
/// Возвращение списка названий коллекций
///
@@ -71,4 +90,135 @@ public class StorageCollection
return null;
}
}
-}
+
+ ///
+ /// Сохранение информации по автомобилям в хранилище в файл
+ ///
+ ///
+ ///
+ public bool SaveData(string filename)
+ {
+ if (_storages.Count == 0)
+ {
+ return false;
+ }
+ if (File.Exists(filename))
+ {
+ File.Delete(filename);
+ }
+ StringBuilder sb = new();
+ sb.Append(_collectionKey);
+ foreach (KeyValuePair> value in _storages)
+ {
+ sb.Append(Environment.NewLine);
+ // не сохраняем пустые коллекции
+ if (value.Value.Count == 0)
+ {
+ continue;
+ }
+ sb.Append(value.Key);
+ sb.Append(_separatorForKeyValue);
+ sb.Append(value.Value.GetCollectionType);
+ sb.Append(_separatorForKeyValue);
+ sb.Append(value.Value.MaxCount);
+ sb.Append(_separatorForKeyValue);
+
+ foreach (T? item in value.Value.GetItems())
+ {
+ string data = item?.GetDataForSave() ?? string.Empty;
+ if (string.IsNullOrEmpty(data))
+ {
+ continue;
+ }
+ sb.Append(data);
+ sb.Append(_separatorItems);
+ }
+ }
+ using FileStream fs = new(filename, FileMode.Create);
+ byte[] info = new UTF8Encoding(true).GetBytes(sb.ToString());
+ fs.Write(info, 0, info.Length);
+ return true;
+ }
+
+ ///
+ /// Загрузка информации по автомобилям в хранилище из файла
+ ///
+ /// >Путь и имя файла
+ /// true - загрузка прошла успешно, false - ошибка при загрузке данных
+ public bool LoadData(string filename)
+ {
+ if (!File.Exists(filename))
+ {
+ return false;
+ }
+ string bufferTextFromFile = "";
+ using (FileStream fs = new(filename, FileMode.Open))
+ {
+ byte[] b = new byte[fs.Length];
+ UTF8Encoding temp = new(true);
+ while (fs.Read(b, 0, b.Length) > 0)
+ {
+ bufferTextFromFile += temp.GetString(b);
+ }
+ }
+ string[] strs = bufferTextFromFile.Split(new char[] { '\n', '\r' },
+ StringSplitOptions.RemoveEmptyEntries);
+ if (strs == null || strs.Length == 0)
+ {
+ return false;
+ }
+ if (!strs[0].Equals(_collectionKey))
+ {
+ //если нет такой записи, то это не те данные
+ return false;
+ }
+ _storages.Clear();
+ foreach (string data in strs)
+ {
+ string[] record = data.Split(_separatorForKeyValue,
+ StringSplitOptions.RemoveEmptyEntries);
+ if (record.Length != 4)
+ {
+ continue;
+ }
+ CollectionType collectionType =
+ (CollectionType)Enum.Parse(typeof(CollectionType), record[1]);
+ ICollectionGenericObjects? collection =
+ StorageCollection.CreateCollection(collectionType);
+ if (collection == null)
+ {
+ return false;
+ }
+ collection.MaxCount = Convert.ToInt32(record[2]);
+ string[] set = record[3].Split(_separatorItems,
+ StringSplitOptions.RemoveEmptyEntries);
+ foreach (string elem in set)
+ {
+ if (elem?.CreateDrawningCar() is T car)
+ {
+ if (collection.Insert(car) == -1)
+ {
+ return false;
+ }
+ }
+ }
+ _storages.Add(record[0], collection);
+ }
+ return true;
+ }
+
+ ///
+ /// Создание коллекции по типу
+ ///
+ ///
+ ///
+ private static ICollectionGenericObjects? CreateCollection(CollectionType collectionType)
+ {
+ return collectionType switch
+ {
+ CollectionType.Massive => new MassiveGenericObjects(),
+ CollectionType.List => new ListGenericObjects(),
+ _ => null,
+ };
+ }
+}
\ No newline at end of file
diff --git a/ProjectCleaningCar/ProjectCleaningCar/Drawning/DrawningCleaningCar.cs b/ProjectCleaningCar/ProjectCleaningCar/Drawning/DrawningCleaningCar.cs
index e8f7287..92eb186 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/Drawning/DrawningCleaningCar.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/Drawning/DrawningCleaningCar.cs
@@ -20,6 +20,17 @@ public class DrawningCleaningCar : DrawningTruck
{
EntityTruck = new EntityCleaningCar(speed, weight, bodyColor, additionalColor, tank, sweepingBrush, flashlight);
}
+
+ ///
+ /// Конструктор для Extention
+ ///
+ ///
+ public DrawningCleaningCar(EntityCleaningCar cleaningCar) : base(132, 65)
+ {
+ if (cleaningCar == null) return;
+ EntityTruck = new EntityCleaningCar(cleaningCar.Speed,cleaningCar.Weight, cleaningCar.BodyColor,
+ cleaningCar.AdditionalColor, cleaningCar.Tank, cleaningCar.SweepingBrush, cleaningCar.Flashlight);
+ }
///
/// Отрисовка объекта
///
diff --git a/ProjectCleaningCar/ProjectCleaningCar/Drawning/DrawningTruck.cs b/ProjectCleaningCar/ProjectCleaningCar/Drawning/DrawningTruck.cs
index 9716c0c..2d218d5 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/Drawning/DrawningTruck.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/Drawning/DrawningTruck.cs
@@ -81,6 +81,15 @@ public class DrawningTruck
_drawningTruckHeight = drawningTruckHeight;
}
///
+ /// Новый конструктор
+ ///
+ ///
+ public DrawningTruck(EntityTruck? truck) : this()
+ {
+ if (truck == null) return;
+ EntityTruck = new EntityTruck(truck.Speed, truck.Weight, truck.BodyColor);
+ }
+ ///
/// Установка границ поля
///
/// Ширина поля
diff --git a/ProjectCleaningCar/ProjectCleaningCar/Drawning/ExtentionDrawningTruck.cs b/ProjectCleaningCar/ProjectCleaningCar/Drawning/ExtentionDrawningTruck.cs
new file mode 100644
index 0000000..249503a
--- /dev/null
+++ b/ProjectCleaningCar/ProjectCleaningCar/Drawning/ExtentionDrawningTruck.cs
@@ -0,0 +1,46 @@
+using ProjectCleaningCar.Entities;
+
+namespace ProjectCleaningCar.Drawning;
+
+///
+/// Расширение для класса EntityTruck
+///
+public static class ExtentionDrawningTruck
+{
+ ///
+ /// Разделитель для записи информации по объекту в файл
+ ///
+ private static readonly string _separatorForObject = ":";
+
+ public static DrawningTruck? CreateDrawningCar(this string info)
+ {
+ string[] strs = info.Split(_separatorForObject);
+ EntityTruck? truck = EntityCleaningCar.CreateEntityCleaningCar(strs);
+ if (truck != null)
+ {
+ return new DrawningCleaningCar((EntityCleaningCar)truck);
+ }
+ truck = EntityTruck.CreateEntityCar(strs);
+ if (truck != null)
+ {
+ return new DrawningTruck(truck);
+ }
+ return null;
+ }
+
+ ///
+ /// Получение данных для сохранения в файл
+ ///
+ ///
+ ///
+ public static string GetDataForSave(this DrawningTruck drawningTruck)
+ {
+ string[]? array = drawningTruck?.EntityTruck?.GetStringRepresentation();
+ if (array == null)
+ {
+ return string.Empty;
+ }
+ return string.Join(_separatorForObject, array);
+ }
+
+}
diff --git a/ProjectCleaningCar/ProjectCleaningCar/Entities/EntityCleaningCar.cs b/ProjectCleaningCar/ProjectCleaningCar/Entities/EntityCleaningCar.cs
index a42e1ce..6b669d3 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/Entities/EntityCleaningCar.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/Entities/EntityCleaningCar.cs
@@ -41,4 +41,28 @@ public class EntityCleaningCar : EntityTruck
SweepingBrush = sweepingBrush;
Flashlight = flashlight;
}
+
+ ///
+ /// Получение строк со значениями свойств продвинутого объекта класса-сущности
+ ///
+ ///
+ public override string[] GetStringRepresentation()
+ {
+ return new[] { nameof(EntityCleaningCar), Speed.ToString(), Weight.ToString(), BodyColor.Name, AdditionalColor.Name,
+ Tank.ToString(), SweepingBrush.ToString(), Flashlight.ToString()};
+ }
+ ///
+ /// Создание продвинутого объекта из массива строк
+ ///
+ ///
+ ///
+ public static EntityCleaningCar? CreateEntityCleaningCar(string[] strs)
+ {
+ if (strs.Length != 8 || strs[0] != nameof(EntityCleaningCar))
+ {
+ return null;
+ }
+ return new EntityCleaningCar(Convert.ToInt32(strs[1]), Convert.ToDouble(strs[2]), Color.FromName(strs[3]),
+ Color.FromName(strs[4]), Convert.ToBoolean(strs[5]), Convert.ToBoolean(strs[6]), Convert.ToBoolean(strs[7]));
+ }
}
diff --git a/ProjectCleaningCar/ProjectCleaningCar/Entities/EntityTruck.cs b/ProjectCleaningCar/ProjectCleaningCar/Entities/EntityTruck.cs
index 4a57db2..da88d54 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/Entities/EntityTruck.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/Entities/EntityTruck.cs
@@ -37,4 +37,27 @@ public class EntityTruck
Weight = weight;
BodyColor = bodyColor;
}
-}
+
+ ///
+ /// Получение строк со значениями свойств объекта класса-сущности
+ ///
+ ///
+ public virtual string[] GetStringRepresentation()
+ {
+ return new[] { nameof(EntityTruck), Speed.ToString(), Weight.ToString(), BodyColor.Name };
+ }
+
+ ///
+ /// Создание объекта из массива строк
+ ///
+ ///
+ ///
+ public static EntityTruck? CreateEntityCar(string[] strs)
+ {
+ if (strs.Length != 4 || strs[0] != nameof(EntityTruck))
+ {
+ return null;
+ }
+ return new EntityTruck(Convert.ToInt32(strs[1]), Convert.ToDouble(strs[2]), Color.FromName(strs[3]));
+ }
+}
\ No newline at end of file
diff --git a/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.Designer.cs b/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.Designer.cs
index 1ff8c11..64dd2c3 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.Designer.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.Designer.cs
@@ -46,10 +46,17 @@
labelCollectionName = new Label();
comboBoxSelectorCompany = new ComboBox();
pictureBox = new PictureBox();
+ menuStrip = new MenuStrip();
+ fileToolStripMenuItem = new ToolStripMenuItem();
+ saveToolStripMenuItem = new ToolStripMenuItem();
+ loadToolStripMenuItem = new ToolStripMenuItem();
+ saveFileDialog = new SaveFileDialog();
+ openFileDialog = new OpenFileDialog();
tools.SuspendLayout();
panelCompanyTools.SuspendLayout();
panelStorage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBox).BeginInit();
+ menuStrip.SuspendLayout();
SuspendLayout();
//
// tools
@@ -59,9 +66,9 @@
tools.Controls.Add(panelStorage);
tools.Controls.Add(comboBoxSelectorCompany);
tools.Dock = DockStyle.Right;
- tools.Location = new Point(783, 0);
+ tools.Location = new Point(783, 24);
tools.Name = "tools";
- tools.Size = new Size(208, 606);
+ tools.Size = new Size(208, 582);
tools.TabIndex = 0;
tools.TabStop = false;
tools.Text = "Инструменты";
@@ -77,12 +84,12 @@
panelCompanyTools.Enabled = false;
panelCompanyTools.Location = new Point(3, 354);
panelCompanyTools.Name = "panelCompanyTools";
- panelCompanyTools.Size = new Size(202, 249);
+ panelCompanyTools.Size = new Size(202, 225);
panelCompanyTools.TabIndex = 7;
//
// buttonRefresh
//
- buttonRefresh.Location = new Point(3, 208);
+ buttonRefresh.Location = new Point(3, 178);
buttonRefresh.Name = "buttonRefresh";
buttonRefresh.Size = new Size(196, 38);
buttonRefresh.TabIndex = 6;
@@ -92,7 +99,7 @@
//
// buttonGoToCheck
//
- buttonGoToCheck.Location = new Point(3, 164);
+ buttonGoToCheck.Location = new Point(3, 134);
buttonGoToCheck.Name = "buttonGoToCheck";
buttonGoToCheck.Size = new Size(196, 38);
buttonGoToCheck.TabIndex = 5;
@@ -113,7 +120,7 @@
//
// maskedTextBoxPosition
//
- maskedTextBoxPosition.Location = new Point(3, 91);
+ maskedTextBoxPosition.Location = new Point(3, 61);
maskedTextBoxPosition.Mask = "00";
maskedTextBoxPosition.Name = "maskedTextBoxPosition";
maskedTextBoxPosition.Size = new Size(196, 23);
@@ -122,7 +129,7 @@
//
// buttonDelCar
//
- buttonDelCar.Location = new Point(3, 120);
+ buttonDelCar.Location = new Point(3, 90);
buttonDelCar.Name = "buttonDelCar";
buttonDelCar.Size = new Size(196, 38);
buttonDelCar.TabIndex = 4;
@@ -237,12 +244,52 @@
// pictureBox
//
pictureBox.Dock = DockStyle.Fill;
- pictureBox.Location = new Point(0, 0);
+ pictureBox.Location = new Point(0, 24);
pictureBox.Name = "pictureBox";
- pictureBox.Size = new Size(783, 606);
+ pictureBox.Size = new Size(783, 582);
pictureBox.TabIndex = 1;
pictureBox.TabStop = false;
//
+ // menuStrip
+ //
+ menuStrip.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem });
+ menuStrip.Location = new Point(0, 0);
+ menuStrip.Name = "menuStrip";
+ menuStrip.Size = new Size(991, 24);
+ menuStrip.TabIndex = 2;
+ menuStrip.Text = "menuStrip";
+ //
+ // fileToolStripMenuItem
+ //
+ fileToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { saveToolStripMenuItem, loadToolStripMenuItem });
+ fileToolStripMenuItem.Name = "fileToolStripMenuItem";
+ fileToolStripMenuItem.Size = new Size(48, 20);
+ fileToolStripMenuItem.Text = "Файл";
+ //
+ // saveToolStripMenuItem
+ //
+ saveToolStripMenuItem.Name = "saveToolStripMenuItem";
+ saveToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.S;
+ saveToolStripMenuItem.Size = new Size(181, 22);
+ saveToolStripMenuItem.Text = "Сохранение";
+ saveToolStripMenuItem.Click += SaveToolStripMenuItem_Click;
+ //
+ // loadToolStripMenuItem
+ //
+ loadToolStripMenuItem.Name = "loadToolStripMenuItem";
+ loadToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.L;
+ loadToolStripMenuItem.Size = new Size(181, 22);
+ loadToolStripMenuItem.Text = "Загрузка";
+ loadToolStripMenuItem.Click += LoadToolStripMenuItem_Click;
+ //
+ // saveFileDialog
+ //
+ saveFileDialog.Filter = "txt file | *.txt";
+ //
+ // openFileDialog
+ //
+ openFileDialog.Filter = "txt file | *.txt";
+ //
// FormCleaningCarCollection
//
AutoScaleDimensions = new SizeF(7F, 15F);
@@ -250,6 +297,8 @@
ClientSize = new Size(991, 606);
Controls.Add(pictureBox);
Controls.Add(tools);
+ Controls.Add(menuStrip);
+ MainMenuStrip = menuStrip;
Name = "FormCleaningCarCollection";
Text = "Коллекция уборочных машин";
tools.ResumeLayout(false);
@@ -258,7 +307,10 @@
panelStorage.ResumeLayout(false);
panelStorage.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureBox).EndInit();
+ menuStrip.ResumeLayout(false);
+ menuStrip.PerformLayout();
ResumeLayout(false);
+ PerformLayout();
}
#endregion
@@ -281,5 +333,11 @@
private TextBox textBoxCollectionName;
private Button buttonCreateCompany;
private Panel panelCompanyTools;
+ private MenuStrip menuStrip;
+ private ToolStripMenuItem fileToolStripMenuItem;
+ private ToolStripMenuItem saveToolStripMenuItem;
+ private ToolStripMenuItem loadToolStripMenuItem;
+ private SaveFileDialog saveFileDialog;
+ private OpenFileDialog openFileDialog;
}
}
\ No newline at end of file
diff --git a/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.cs b/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.cs
index 86b053e..94f2193 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.cs
+++ b/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.cs
@@ -235,4 +235,39 @@ public partial class FormCleaningCarCollection : Form
panelCompanyTools.Enabled = true;
RerfreshListBoxItems();
}
-}
+
+ ///
+ /// Обработка нажатия "Сохранение"
+ ///
+ ///
+ ///
+ private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (saveFileDialog.ShowDialog() == DialogResult.OK)
+ {
+ if (_storageCollection.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)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.resx b/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.resx
index af32865..8b1dfa1 100644
--- a/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.resx
+++ b/ProjectCleaningCar/ProjectCleaningCar/FormCleaningCarCollection.resx
@@ -117,4 +117,13 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 17, 17
+
+
+ 126, 17
+
+
+ 261, 17
+
\ No newline at end of file