diff --git a/ProjectTank/ProjectTank/CollectionGenericObjects/CollectionType.cs b/ProjectTank/ProjectTank/CollectionGenericObjects/CollectionType.cs
new file mode 100644
index 0000000..437004a
--- /dev/null
+++ b/ProjectTank/ProjectTank/CollectionGenericObjects/CollectionType.cs
@@ -0,0 +1,22 @@
+namespace ProjectTank.CollectionGenericObjects;
+
+///
+/// Тип коллекции
+///
+public enum CollectionType
+{
+ ///
+ /// Неопределено
+ ///
+ None = 0,
+
+ ///
+ /// Массив
+ ///
+ Massive = 1,
+
+ ///
+ /// Список
+ ///
+ List = 2
+}
\ No newline at end of file
diff --git a/ProjectTank/ProjectTank/CollectionGenericObjects/ListGenericObjects.cs b/ProjectTank/ProjectTank/CollectionGenericObjects/ListGenericObjects.cs
new file mode 100644
index 0000000..efb07ca
--- /dev/null
+++ b/ProjectTank/ProjectTank/CollectionGenericObjects/ListGenericObjects.cs
@@ -0,0 +1,58 @@
+namespace ProjectTank.CollectionGenericObjects;
+
+public class ListGenericObjects : ICollectionGenericObjects
+ where T : class
+{
+ ///
+ /// Список объектов, которые храним
+ ///
+ private readonly List _collection;
+ ///
+ /// Максимально допустимое число объектов в списке
+ ///
+ private int _maxCount;
+ public int Count => _collection.Count;
+ public int SetMaxCount { set { if (value > 0) { _maxCount = value; } } }
+ ///
+ /// Конструктор
+ ///
+ public ListGenericObjects()
+ {
+ _collection = new();
+ }
+ public T? Get(int position)
+ {
+ // TODO проверка позиции
+ if (position >= Count || position < 0) return null;
+ return _collection[position];
+ }
+ public int Insert(T obj)
+ {
+ // TODO проверка, что не превышено максимальное количество элементов
+ // TODO вставка в конец набора
+
+ if (Count + 1 > _maxCount) return -1;
+ _collection.Add(obj);
+ return Count;
+ }
+ public int Insert(T obj, int position)
+ {
+ // TODO проверка, что не превышено максимальное количество элементов
+ // TODO проверка позиции
+ // TODO вставка по позиции
+ if (Count + 1 > _maxCount) return -1;
+ if (position < 0 || position > Count) return -1;
+ _collection.Insert(position, obj);
+ return 1;
+ }
+ public T? Remove(int position)
+ {
+ // TODO проверка позиции
+ // TODO удаление объекта из списка
+ if (position < 0 || position > Count) return null;
+ T? temp = _collection[position];
+ _collection.RemoveAt(position);
+ return temp;
+ }
+
+}
diff --git a/ProjectTank/ProjectTank/CollectionGenericObjects/StorageCollection.cs b/ProjectTank/ProjectTank/CollectionGenericObjects/StorageCollection.cs
new file mode 100644
index 0000000..c35f933
--- /dev/null
+++ b/ProjectTank/ProjectTank/CollectionGenericObjects/StorageCollection.cs
@@ -0,0 +1,80 @@
+namespace ProjectTank.CollectionGenericObjects;
+
+///
+/// Класс-хранилище коллекций
+///
+///
+internal class StorageCollection
+ where T : class
+{
+ ///
+ /// Словарь (хранилище) с коллекциями
+ ///
+ readonly Dictionary> _storages;
+
+ ///
+ /// Возвращение списка названий коллекций
+ ///
+ public List Keys => _storages.Keys.ToList();
+
+ ///
+ /// Конструктор
+ ///
+ public StorageCollection()
+ {
+ _storages = new Dictionary>();
+ }
+
+ ///
+ /// Добавление коллекции в хранилище
+ ///
+ /// Название коллекции
+ /// тип коллекции
+ public void AddCollection(string name, CollectionType collectionType)
+ {
+ // TODO проверка, что name не пустой и нет в словаре записи с таким ключом
+ // TODO Прописать логику для добавления
+ if (name == null || _storages.ContainsKey(name))
+ return;
+ switch (collectionType)
+ {
+ case CollectionType.None:
+ return;
+ case CollectionType.Massive:
+ _storages[name] = new MassiveGenericObjects();
+ return;
+ case CollectionType.List:
+ _storages[name] = new ListGenericObjects();
+ return;
+ }
+
+ }
+
+ ///
+ /// Удаление коллекции
+ ///
+ /// Название коллекции
+ public void DelCollection(string name)
+ {
+ // TODO Прописать логику для удаления коллекции
+ if (_storages.ContainsKey(name))
+ _storages.Remove(name);
+ }
+
+ ///
+ /// Доступ к коллекции
+ ///
+ /// Название коллекции
+ ///
+ public ICollectionGenericObjects? this[string name]
+ {
+ get
+ {
+ // TODO Продумать логику получения объекта
+ if (name == null || !_storages.ContainsKey(name))
+ return null;
+ return _storages[name];
+ }
+ }
+
+}
diff --git a/ProjectTank/ProjectTank/FormTankCollection.Designer.cs b/ProjectTank/ProjectTank/FormTankCollection.Designer.cs
index 1a8283f..2fecb7a 100644
--- a/ProjectTank/ProjectTank/FormTankCollection.Designer.cs
+++ b/ProjectTank/ProjectTank/FormTankCollection.Designer.cs
@@ -29,26 +29,35 @@
private void InitializeComponent()
{
groupBoxTools = new GroupBox();
- comboBoxSelectorCompany = new ComboBox();
- buttonAddTank2 = new Button();
- buttonAddTank = new Button();
- pictureBox = new PictureBox();
- maskedTextBox = new MaskedTextBox();
- buttonDelTank = new Button();
- buttonGoToCheck = new Button();
+ buttonCreateCompany = new Button();
+ panelStorage = new Panel();
+ buttonCollectinDel = new Button();
+ listBoxCollection = new ListBox();
+ buttonCollectionAdd = new Button();
+ radioButtonList = new RadioButton();
+ radioButtonMassive = new RadioButton();
+ textBoxCollectionName = new TextBox();
+ labelCollectionName = new Label();
buttonRefresh = new Button();
+ buttonGoToCheck = new Button();
+ buttonDelTank = new Button();
+ maskedTextBox = new MaskedTextBox();
+ buttonAddTank = new Button();
+ buttonAddTank2 = new Button();
+ comboBoxSelectorCompany = new ComboBox();
+ pictureBox = new PictureBox();
+ panelCompanyTools = new Panel();
groupBoxTools.SuspendLayout();
+ panelStorage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBox).BeginInit();
+ panelCompanyTools.SuspendLayout();
SuspendLayout();
//
// groupBoxTools
//
- groupBoxTools.Controls.Add(buttonRefresh);
- groupBoxTools.Controls.Add(buttonGoToCheck);
- groupBoxTools.Controls.Add(buttonDelTank);
- groupBoxTools.Controls.Add(maskedTextBox);
- groupBoxTools.Controls.Add(buttonAddTank);
- groupBoxTools.Controls.Add(buttonAddTank2);
+ groupBoxTools.Controls.Add(panelCompanyTools);
+ groupBoxTools.Controls.Add(buttonCreateCompany);
+ groupBoxTools.Controls.Add(panelStorage);
groupBoxTools.Controls.Add(comboBoxSelectorCompany);
groupBoxTools.Dock = DockStyle.Right;
groupBoxTools.Location = new Point(931, 0);
@@ -58,40 +67,175 @@
groupBoxTools.TabStop = false;
groupBoxTools.Text = "Инструменты";
//
+ // buttonCreateCompany
+ //
+ buttonCreateCompany.Location = new Point(6, 339);
+ buttonCreateCompany.Name = "buttonCreateCompany";
+ buttonCreateCompany.Size = new Size(206, 34);
+ buttonCreateCompany.TabIndex = 8;
+ buttonCreateCompany.Text = "Создать компанию";
+ buttonCreateCompany.UseVisualStyleBackColor = true;
+ buttonCreateCompany.Click += ButtonCreateCompany_Click;
+ //
+ // panelStorage
+ //
+ panelStorage.Controls.Add(buttonCollectinDel);
+ panelStorage.Controls.Add(listBoxCollection);
+ panelStorage.Controls.Add(buttonCollectionAdd);
+ panelStorage.Controls.Add(radioButtonList);
+ panelStorage.Controls.Add(radioButtonMassive);
+ panelStorage.Controls.Add(textBoxCollectionName);
+ panelStorage.Controls.Add(labelCollectionName);
+ panelStorage.Dock = DockStyle.Top;
+ panelStorage.Location = new Point(3, 23);
+ panelStorage.Name = "panelStorage";
+ panelStorage.Size = new Size(212, 276);
+ panelStorage.TabIndex = 7;
+ //
+ // buttonCollectinDel
+ //
+ buttonCollectinDel.Location = new Point(3, 241);
+ buttonCollectinDel.Name = "buttonCollectinDel";
+ buttonCollectinDel.Size = new Size(206, 29);
+ buttonCollectinDel.TabIndex = 6;
+ buttonCollectinDel.Text = "Удалить коллекцию";
+ buttonCollectinDel.UseVisualStyleBackColor = true;
+ buttonCollectinDel.Click += ButtonCollectinDel_Click;
+ //
+ // listBoxCollection
+ //
+ listBoxCollection.FormattingEnabled = true;
+ listBoxCollection.ItemHeight = 20;
+ listBoxCollection.Location = new Point(3, 131);
+ listBoxCollection.Name = "listBoxCollection";
+ listBoxCollection.Size = new Size(206, 104);
+ listBoxCollection.TabIndex = 5;
+ //
+ // buttonCollectionAdd
+ //
+ buttonCollectionAdd.Location = new Point(3, 96);
+ buttonCollectionAdd.Name = "buttonCollectionAdd";
+ buttonCollectionAdd.Size = new Size(206, 29);
+ buttonCollectionAdd.TabIndex = 4;
+ buttonCollectionAdd.Text = "Добавить коллекцию";
+ buttonCollectionAdd.UseVisualStyleBackColor = true;
+ buttonCollectionAdd.Click += ButtonCollectionAdd_Click;
+ //
+ // radioButtonList
+ //
+ radioButtonList.AutoSize = true;
+ radioButtonList.Location = new Point(106, 66);
+ radioButtonList.Name = "radioButtonList";
+ radioButtonList.Size = new Size(80, 24);
+ radioButtonList.TabIndex = 3;
+ radioButtonList.TabStop = true;
+ radioButtonList.Text = "Список";
+ radioButtonList.UseVisualStyleBackColor = true;
+ //
+ // radioButtonMassive
+ //
+ radioButtonMassive.AutoSize = true;
+ radioButtonMassive.Location = new Point(18, 66);
+ radioButtonMassive.Name = "radioButtonMassive";
+ radioButtonMassive.Size = new Size(82, 24);
+ radioButtonMassive.TabIndex = 2;
+ radioButtonMassive.TabStop = true;
+ radioButtonMassive.Text = "Массив";
+ radioButtonMassive.UseVisualStyleBackColor = true;
+ //
+ // textBoxCollectionName
+ //
+ textBoxCollectionName.Location = new Point(3, 33);
+ textBoxCollectionName.Name = "textBoxCollectionName";
+ textBoxCollectionName.Size = new Size(206, 27);
+ textBoxCollectionName.TabIndex = 1;
+ //
+ // labelCollectionName
+ //
+ labelCollectionName.AutoSize = true;
+ labelCollectionName.Location = new Point(27, 10);
+ labelCollectionName.Name = "labelCollectionName";
+ labelCollectionName.Size = new Size(158, 20);
+ labelCollectionName.TabIndex = 0;
+ labelCollectionName.Text = "Название коллекции:";
+ //
+ // buttonRefresh
+ //
+ buttonRefresh.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ buttonRefresh.Location = new Point(4, 253);
+ buttonRefresh.Name = "buttonRefresh";
+ buttonRefresh.Size = new Size(202, 49);
+ buttonRefresh.TabIndex = 6;
+ buttonRefresh.Text = "Обновить";
+ buttonRefresh.UseVisualStyleBackColor = true;
+ buttonRefresh.Click += ButtonRefresh_Click;
+ //
+ // buttonGoToCheck
+ //
+ buttonGoToCheck.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ buttonGoToCheck.Location = new Point(3, 198);
+ buttonGoToCheck.Name = "buttonGoToCheck";
+ buttonGoToCheck.Size = new Size(203, 49);
+ buttonGoToCheck.TabIndex = 5;
+ buttonGoToCheck.Text = "Передать на тесты";
+ buttonGoToCheck.UseVisualStyleBackColor = true;
+ buttonGoToCheck.Click += ButtonGoToCheck_Click;
+ //
+ // buttonDelTank
+ //
+ buttonDelTank.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ buttonDelTank.Location = new Point(3, 143);
+ buttonDelTank.Name = "buttonDelTank";
+ buttonDelTank.Size = new Size(203, 49);
+ buttonDelTank.TabIndex = 4;
+ buttonDelTank.Text = "Удалить танка ";
+ buttonDelTank.UseVisualStyleBackColor = true;
+ buttonDelTank.Click += ButtonDelTank_Click;
+ //
+ // maskedTextBox
+ //
+ maskedTextBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ maskedTextBox.Location = new Point(4, 110);
+ maskedTextBox.Mask = "00";
+ maskedTextBox.Name = "maskedTextBox";
+ maskedTextBox.Size = new Size(202, 27);
+ maskedTextBox.TabIndex = 3;
+ maskedTextBox.ValidatingType = typeof(int);
+ //
+ // buttonAddTank
+ //
+ buttonAddTank.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ buttonAddTank.Location = new Point(4, 55);
+ buttonAddTank.Name = "buttonAddTank";
+ buttonAddTank.Size = new Size(202, 49);
+ buttonAddTank.TabIndex = 2;
+ buttonAddTank.Text = "Добавление танка ";
+ buttonAddTank.UseVisualStyleBackColor = true;
+ buttonAddTank.Click += ButtonAddTank_Click;
+ //
+ // buttonAddTank2
+ //
+ buttonAddTank2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ buttonAddTank2.Location = new Point(4, 0);
+ buttonAddTank2.Name = "buttonAddTank2";
+ buttonAddTank2.Size = new Size(202, 49);
+ buttonAddTank2.TabIndex = 1;
+ buttonAddTank2.Text = "Добавление бронированной машины";
+ buttonAddTank2.UseVisualStyleBackColor = true;
+ buttonAddTank2.Click += ButtonAddTank2_Click;
+ //
// comboBoxSelectorCompany
//
comboBoxSelectorCompany.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
comboBoxSelectorCompany.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxSelectorCompany.FormattingEnabled = true;
comboBoxSelectorCompany.Items.AddRange(new object[] { "Хранилище" });
- comboBoxSelectorCompany.Location = new Point(6, 26);
+ comboBoxSelectorCompany.Location = new Point(6, 305);
comboBoxSelectorCompany.Name = "comboBoxSelectorCompany";
comboBoxSelectorCompany.Size = new Size(206, 28);
comboBoxSelectorCompany.TabIndex = 0;
comboBoxSelectorCompany.SelectedIndexChanged += ComboBoxSelectorCompany_SelectedIndexChanged;
//
- // buttonAddTank2
- //
- buttonAddTank2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
- buttonAddTank2.Location = new Point(6, 111);
- buttonAddTank2.Name = "buttonAddTank2";
- buttonAddTank2.Size = new Size(206, 49);
- buttonAddTank2.TabIndex = 1;
- buttonAddTank2.Text = "Добавление бронированной машины";
- buttonAddTank2.UseVisualStyleBackColor = true;
- buttonAddTank2.Click += ButtonAddTank2_Click;
- //
- // buttonAddTank
- //
- buttonAddTank.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
- buttonAddTank.Location = new Point(6, 166);
- buttonAddTank.Name = "buttonAddTank";
- buttonAddTank.Size = new Size(206, 49);
- buttonAddTank.TabIndex = 2;
- buttonAddTank.Text = "Добавление танка ";
- buttonAddTank.UseVisualStyleBackColor = true;
- buttonAddTank.Click += ButtonAddTank_Click;
- //
// pictureBox
//
pictureBox.Dock = DockStyle.Fill;
@@ -100,50 +244,21 @@
pictureBox.Size = new Size(931, 687);
pictureBox.TabIndex = 1;
pictureBox.TabStop = false;
-
//
- // maskedTextBox
+ // panelCompanyTools
//
- maskedTextBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
- maskedTextBox.Location = new Point(6, 276);
- maskedTextBox.Mask = "00";
- maskedTextBox.Name = "maskedTextBox";
- maskedTextBox.Size = new Size(206, 27);
- maskedTextBox.TabIndex = 3;
- maskedTextBox.ValidatingType = typeof(int);
- //
- // buttonDelTank
- //
- buttonDelTank.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
- buttonDelTank.Location = new Point(6, 309);
- buttonDelTank.Name = "buttonDelTank";
- buttonDelTank.Size = new Size(206, 49);
- buttonDelTank.TabIndex = 4;
- buttonDelTank.Text = "Удалить танка ";
- buttonDelTank.UseVisualStyleBackColor = true;
- buttonDelTank.Click += ButtonDelTank_Click;
- //
- // buttonGoToCheck
- //
- buttonGoToCheck.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
- buttonGoToCheck.Location = new Point(6, 428);
- buttonGoToCheck.Name = "buttonGoToCheck";
- buttonGoToCheck.Size = new Size(206, 49);
- buttonGoToCheck.TabIndex = 5;
- buttonGoToCheck.Text = "Передать на тесты";
- buttonGoToCheck.UseVisualStyleBackColor = true;
- buttonGoToCheck.Click += ButtonGoToCheck_Click;
- //
- // buttonRefresh
- //
- buttonRefresh.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
- buttonRefresh.Location = new Point(6, 556);
- buttonRefresh.Name = "buttonRefresh";
- buttonRefresh.Size = new Size(206, 49);
- buttonRefresh.TabIndex = 6;
- buttonRefresh.Text = "Обновить";
- buttonRefresh.UseVisualStyleBackColor = true;
- buttonRefresh.Click += ButtonRefresh_Click;
+ panelCompanyTools.Controls.Add(buttonDelTank);
+ panelCompanyTools.Controls.Add(buttonRefresh);
+ panelCompanyTools.Controls.Add(maskedTextBox);
+ panelCompanyTools.Controls.Add(buttonAddTank2);
+ panelCompanyTools.Controls.Add(buttonGoToCheck);
+ panelCompanyTools.Controls.Add(buttonAddTank);
+ panelCompanyTools.Dock = DockStyle.Bottom;
+ panelCompanyTools.Enabled = false;
+ panelCompanyTools.Location = new Point(3, 382);
+ panelCompanyTools.Name = "panelCompanyTools";
+ panelCompanyTools.Size = new Size(212, 302);
+ panelCompanyTools.TabIndex = 9;
//
// FormTankCollection
//
@@ -155,8 +270,11 @@
Name = "FormTankCollection";
Text = "Коллекция танков";
groupBoxTools.ResumeLayout(false);
- groupBoxTools.PerformLayout();
+ panelStorage.ResumeLayout(false);
+ panelStorage.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureBox).EndInit();
+ panelCompanyTools.ResumeLayout(false);
+ panelCompanyTools.PerformLayout();
ResumeLayout(false);
}
@@ -171,5 +289,15 @@
private PictureBox pictureBox;
private Button buttonGoToCheck;
private Button buttonRefresh;
+ private Panel panelStorage;
+ private Label labelCollectionName;
+ private RadioButton radioButtonList;
+ private RadioButton radioButtonMassive;
+ private TextBox textBoxCollectionName;
+ private Button buttonCreateCompany;
+ private Button buttonCollectinDel;
+ private ListBox listBoxCollection;
+ private Button buttonCollectionAdd;
+ private Panel panelCompanyTools;
}
}
\ No newline at end of file
diff --git a/ProjectTank/ProjectTank/FormTankCollection.cs b/ProjectTank/ProjectTank/FormTankCollection.cs
index 51ae841..bac09ae 100644
--- a/ProjectTank/ProjectTank/FormTankCollection.cs
+++ b/ProjectTank/ProjectTank/FormTankCollection.cs
@@ -9,6 +9,11 @@ namespace ProjectTank;
///
public partial class FormTankCollection : Form
{
+ ///
+ /// Хранилише коллекций
+ ///
+ private readonly StorageCollection _storageCollection;
+
///
/// Компания
///
@@ -20,6 +25,7 @@ public partial class FormTankCollection : Form
public FormTankCollection()
{
InitializeComponent();
+ _storageCollection = new();
}
///
@@ -29,12 +35,7 @@ public partial class FormTankCollection : Form
///
private void ComboBoxSelectorCompany_SelectedIndexChanged(object sender, EventArgs e)
{
- switch (comboBoxSelectorCompany.Text)
- {
- case "Хранилище":
- _company = new TankBase(pictureBox.Width, pictureBox.Height, new MassiveGenericObjects());
- break;
- }
+ panelCompanyTools.Enabled = false;
}
///
@@ -187,4 +188,99 @@ public partial class FormTankCollection : Form
pictureBox.Image = _company.Show();
}
+
+ ///
+ /// Добавление коллекции
+ ///
+ ///
+ ///
+ private void ButtonCollectionAdd_Click(object sender, EventArgs e)
+ {
+ if (string.IsNullOrEmpty(textBoxCollectionName.Text) || (!radioButtonList.Checked && !radioButtonMassive.Checked))
+ {
+ MessageBox.Show("Не все данные заполнены", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return;
+ }
+
+ CollectionType collectionType = CollectionType.None;
+ if (radioButtonMassive.Checked)
+ {
+ collectionType = CollectionType.Massive;
+ }
+ else if (radioButtonList.Checked)
+ {
+ collectionType = CollectionType.List;
+ }
+
+ _storageCollection.AddCollection(textBoxCollectionName.Text, collectionType);
+ RerfreshListBoxItems();
+
+ }
+
+ ///
+ /// Удаление коллекции
+ ///
+ ///
+ ///
+ private void ButtonCollectinDel_Click(object sender, EventArgs e)
+ {
+ if (listBoxCollection.SelectedIndex < 0 || listBoxCollection.SelectedItem == null)
+ {
+ MessageBox.Show("Коллекция не выбрана");
+ return;
+ }
+ if (MessageBox.Show("Удалить коллекцию?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
+ {
+ return;
+ }
+ _storageCollection.DelCollection(listBoxCollection.SelectedItem.ToString());
+ RerfreshListBoxItems();
+ }
+
+ ///
+ /// Обновление списка в listBoxCollection
+ ///
+ private void RerfreshListBoxItems()
+ {
+ listBoxCollection.Items.Clear();
+ for (int i = 0; i < _storageCollection.Keys?.Count; ++i)
+ {
+ string? colName = _storageCollection.Keys?[i];
+ if (!string.IsNullOrEmpty(colName))
+ {
+ listBoxCollection.Items.Add(colName);
+ }
+ }
+
+ }
+
+ ///
+ /// Создание компании
+ ///
+ ///
+ ///
+ private void ButtonCreateCompany_Click(object sender, EventArgs e)
+ {
+ if (listBoxCollection.SelectedIndex < 0 || listBoxCollection.SelectedItem == null)
+ {
+ MessageBox.Show("Коллекция не выбрана");
+ return;
+ }
+
+ ICollectionGenericObjects? collection = _storageCollection[listBoxCollection.SelectedItem.ToString() ?? string.Empty];
+ if (collection == null)
+ {
+ MessageBox.Show("Коллекция не проинициализирована");
+ return;
+ }
+
+ switch (comboBoxSelectorCompany.Text)
+ {
+ case "Хранилище":
+ _company = new TankBase(pictureBox.Width, pictureBox.Height, collection);
+ break;
+ }
+ panelCompanyTools.Enabled = true;
+ RerfreshListBoxItems();
+ }
}
\ No newline at end of file