From 2fa4300a97e977ab431f75859220ff3c6da818b4 Mon Sep 17 00:00:00 2001 From: Evgehil Date: Sun, 17 Mar 2024 19:24:38 +0400 Subject: [PATCH 1/3] =?UTF-8?q?4=20=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CollectionType.cs | 22 +++ .../ListGenericObjects.cs | 61 +++++++ .../MassiveGenericObjects.cs | 16 +- .../StorageCollection.cs | 68 +++++++ .../FormAirplanCollection.Designer.cs | 166 ++++++++++++++++-- .../Project_airbus/FormAirplanCollection.cs | 108 +++++++++++- 6 files changed, 402 insertions(+), 39 deletions(-) create mode 100644 Project_airbus/Project_airbus/CollectionGenericObjects/CollectionType.cs create mode 100644 Project_airbus/Project_airbus/CollectionGenericObjects/ListGenericObjects.cs create mode 100644 Project_airbus/Project_airbus/CollectionGenericObjects/StorageCollection.cs diff --git a/Project_airbus/Project_airbus/CollectionGenericObjects/CollectionType.cs b/Project_airbus/Project_airbus/CollectionGenericObjects/CollectionType.cs new file mode 100644 index 0000000..43531c3 --- /dev/null +++ b/Project_airbus/Project_airbus/CollectionGenericObjects/CollectionType.cs @@ -0,0 +1,22 @@ +namespace Project_airbus.CollectionGenericObjects; + + /// + /// Тип коллекции + /// +public enum CollectionType +{ + /// + /// Неопределено + /// + None = 0, + + /// + /// Массив + /// + Massive = 1, + + /// + /// Список + /// + List = 2 +} \ No newline at end of file diff --git a/Project_airbus/Project_airbus/CollectionGenericObjects/ListGenericObjects.cs b/Project_airbus/Project_airbus/CollectionGenericObjects/ListGenericObjects.cs new file mode 100644 index 0000000..06f3670 --- /dev/null +++ b/Project_airbus/Project_airbus/CollectionGenericObjects/ListGenericObjects.cs @@ -0,0 +1,61 @@ +namespace Project_airbus.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) + { + if (position >= Count || position < 0) return null; + return _collection[position]; + } + + public int Insert(T obj) + { + if (Count == _maxCount) return -1; + _collection.Add(obj); + return Count; + } + + public int Insert(T obj, int position) + { + if (Count == _maxCount) return -1; + if (position >= Count || position < 0) return -1; + _collection.Insert(position, obj); + return position; + } + + public T Remove(int position) + { + if (position >= _collection.Count || position < 0) return null; + T obj = _collection[position]; + _collection.RemoveAt(position); + return obj; + } + +} diff --git a/Project_airbus/Project_airbus/CollectionGenericObjects/MassiveGenericObjects.cs b/Project_airbus/Project_airbus/CollectionGenericObjects/MassiveGenericObjects.cs index 0d04590..7cef140 100644 --- a/Project_airbus/Project_airbus/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/Project_airbus/Project_airbus/CollectionGenericObjects/MassiveGenericObjects.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Project_airbus.CollectionGenericObjects; +namespace Project_airbus.CollectionGenericObjects; /// /// Параметризованный набор объектов @@ -48,14 +42,12 @@ public class MassiveGenericObjects : ICollectionGenericObjects public T? Get(int position) { - // TODO проверка позиции if (position >= _collection.Length || position < 0) return null; return _collection[position]; } public int Insert(T obj) { - // TODO вставка в свободное место набора int index = 0; while (index < _collection.Length) { @@ -72,12 +64,8 @@ public class MassiveGenericObjects : ICollectionGenericObjects public int Insert(T obj, int position) { - // TODO проверка позиции - // TODO проверка, что элемент массива по этой позиции пустой, если нет, то - // ищется свободное место после этой позиции и идет вставка туда - // если нет после, ищем до - // TODO вставка if (position >= _collection.Length || position < 0) return -1; + if (_collection[position] == null) { _collection[position] = obj; diff --git a/Project_airbus/Project_airbus/CollectionGenericObjects/StorageCollection.cs b/Project_airbus/Project_airbus/CollectionGenericObjects/StorageCollection.cs new file mode 100644 index 0000000..fc492e3 --- /dev/null +++ b/Project_airbus/Project_airbus/CollectionGenericObjects/StorageCollection.cs @@ -0,0 +1,68 @@ +namespace Project_airbus.CollectionGenericObjects; + +/// +/// Класс-хранилище коллекций +/// +/// +public 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) + { + + if (_storages.ContainsKey(name)) return; + if (collectionType == CollectionType.None) return; + else if (collectionType == CollectionType.Massive) + _storages[name] = new MassiveGenericObjects(); + else if (collectionType == CollectionType.List) + _storages[name] = new ListGenericObjects(); + } + + /// + /// Удаление коллекции + /// + /// Название коллекции + public void DelCollection(string name) + { + if (_storages.ContainsKey(name)) + _storages.Remove(name); + } + + /// + /// Доступ к коллекции + /// + /// Название коллекции + /// + public ICollectionGenericObjects? this[string name] + { + get + { + if (_storages.ContainsKey(name)) + return _storages[name]; + return null; + } + } +} diff --git a/Project_airbus/Project_airbus/FormAirplanCollection.Designer.cs b/Project_airbus/Project_airbus/FormAirplanCollection.Designer.cs index bf27fec..9b79560 100644 --- a/Project_airbus/Project_airbus/FormAirplanCollection.Designer.cs +++ b/Project_airbus/Project_airbus/FormAirplanCollection.Designer.cs @@ -29,6 +29,15 @@ private void InitializeComponent() { groupBoxTools = new GroupBox(); + buttonCreateToCompany = new Button(); + panelStorage = new Panel(); + buttonCollectionDel = 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(); ButtonDelAirplan = new Button(); @@ -37,30 +46,122 @@ buttonAddAirplan = 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(ButtonDelAirplan); - groupBoxTools.Controls.Add(maskedTextBox); - groupBoxTools.Controls.Add(buttonAddAirbus); - groupBoxTools.Controls.Add(buttonAddAirplan); + groupBoxTools.Controls.Add(panelCompanyTools); + groupBoxTools.Controls.Add(buttonCreateToCompany); + groupBoxTools.Controls.Add(panelStorage); groupBoxTools.Controls.Add(comboBoxSelectorCompany); groupBoxTools.Dock = DockStyle.Right; - groupBoxTools.Location = new Point(860, 0); + groupBoxTools.Location = new Point(925, 0); groupBoxTools.Name = "groupBoxTools"; - groupBoxTools.Size = new Size(210, 617); + groupBoxTools.Size = new Size(210, 707); groupBoxTools.TabIndex = 0; groupBoxTools.TabStop = false; groupBoxTools.Text = "Инструменты"; // + // buttonCreateToCompany + // + buttonCreateToCompany.Location = new Point(6, 368); + buttonCreateToCompany.Name = "buttonCreateToCompany"; + buttonCreateToCompany.Size = new Size(192, 26); + buttonCreateToCompany.TabIndex = 8; + buttonCreateToCompany.Text = "Создать компанию"; + buttonCreateToCompany.UseVisualStyleBackColor = true; + buttonCreateToCompany.Click += buttonCreateToCompany_Click; + // + // panelStorage + // + panelStorage.Controls.Add(buttonCollectionDel); + 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(204, 267); + panelStorage.TabIndex = 7; + // + // buttonCollectionDel + // + buttonCollectionDel.Location = new Point(0, 211); + buttonCollectionDel.Name = "buttonCollectionDel"; + buttonCollectionDel.Size = new Size(207, 26); + buttonCollectionDel.TabIndex = 6; + buttonCollectionDel.Text = "Удалить коллекцию"; + buttonCollectionDel.UseVisualStyleBackColor = true; + buttonCollectionDel.Click += buttonCollectionDel_Click; + // + // listBoxCollection + // + listBoxCollection.FormattingEnabled = true; + listBoxCollection.ItemHeight = 20; + listBoxCollection.Location = new Point(3, 141); + listBoxCollection.Name = "listBoxCollection"; + listBoxCollection.Size = new Size(201, 64); + listBoxCollection.TabIndex = 5; + // + // buttonCollectionAdd + // + buttonCollectionAdd.Location = new Point(-3, 109); + buttonCollectionAdd.Name = "buttonCollectionAdd"; + buttonCollectionAdd.Size = new Size(207, 26); + buttonCollectionAdd.TabIndex = 4; + buttonCollectionAdd.Text = "Добавить коллекцию"; + buttonCollectionAdd.UseVisualStyleBackColor = true; + buttonCollectionAdd.Click += buttonCollectionAdd_Click; + // + // radioButtonList + // + radioButtonList.AutoSize = true; + radioButtonList.Location = new Point(115, 79); + 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, 79); + 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, 36); + textBoxCollectionName.Name = "textBoxCollectionName"; + textBoxCollectionName.Size = new Size(198, 27); + textBoxCollectionName.TabIndex = 1; + // + // labelCollectionName + // + labelCollectionName.AutoSize = true; + labelCollectionName.Location = new Point(28, 13); + labelCollectionName.Name = "labelCollectionName"; + labelCollectionName.Size = new Size(155, 20); + labelCollectionName.TabIndex = 0; + labelCollectionName.Text = "Название коллекции"; + // // buttonRefresh // - buttonRefresh.Location = new Point(6, 495); + buttonRefresh.Location = new Point(3, 253); buttonRefresh.Name = "buttonRefresh"; buttonRefresh.Size = new Size(195, 46); buttonRefresh.TabIndex = 6; @@ -70,7 +171,7 @@ // // buttonGoToCheck // - buttonGoToCheck.Location = new Point(6, 355); + buttonGoToCheck.Location = new Point(3, 201); buttonGoToCheck.Name = "buttonGoToCheck"; buttonGoToCheck.Size = new Size(195, 46); buttonGoToCheck.TabIndex = 5; @@ -80,7 +181,7 @@ // // ButtonDelAirplan // - ButtonDelAirplan.Location = new Point(6, 267); + ButtonDelAirplan.Location = new Point(3, 149); ButtonDelAirplan.Name = "ButtonDelAirplan"; ButtonDelAirplan.Size = new Size(195, 46); ButtonDelAirplan.TabIndex = 4; @@ -90,7 +191,7 @@ // // maskedTextBox // - maskedTextBox.Location = new Point(6, 234); + maskedTextBox.Location = new Point(3, 116); maskedTextBox.Mask = "00"; maskedTextBox.Name = "maskedTextBox"; maskedTextBox.Size = new Size(192, 27); @@ -99,7 +200,7 @@ // // buttonAddAirbus // - buttonAddAirbus.Location = new Point(6, 142); + buttonAddAirbus.Location = new Point(3, 63); buttonAddAirbus.Name = "buttonAddAirbus"; buttonAddAirbus.Size = new Size(192, 47); buttonAddAirbus.TabIndex = 2; @@ -109,7 +210,7 @@ // // buttonAddAirplan // - buttonAddAirplan.Location = new Point(6, 85); + buttonAddAirplan.Location = new Point(3, 6); buttonAddAirplan.Name = "buttonAddAirplan"; buttonAddAirplan.Size = new Size(192, 51); buttonAddAirplan.TabIndex = 1; @@ -123,9 +224,9 @@ comboBoxSelectorCompany.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxSelectorCompany.FormattingEnabled = true; comboBoxSelectorCompany.Items.AddRange(new object[] { "Хранилище" }); - comboBoxSelectorCompany.Location = new Point(6, 26); + comboBoxSelectorCompany.Location = new Point(6, 334); comboBoxSelectorCompany.Name = "comboBoxSelectorCompany"; - comboBoxSelectorCompany.Size = new Size(192, 28); + comboBoxSelectorCompany.Size = new Size(140, 28); comboBoxSelectorCompany.TabIndex = 0; comboBoxSelectorCompany.SelectedIndexChanged += ComboBoxSelectorCompany_SelectedIndexChanged; // @@ -134,22 +235,39 @@ pictureBox.Dock = DockStyle.Fill; pictureBox.Location = new Point(0, 0); pictureBox.Name = "pictureBox"; - pictureBox.Size = new Size(860, 617); + pictureBox.Size = new Size(925, 707); pictureBox.TabIndex = 1; pictureBox.TabStop = false; // + // panelCompanyTools + // + panelCompanyTools.Controls.Add(buttonAddAirplan); + panelCompanyTools.Controls.Add(buttonAddAirbus); + panelCompanyTools.Controls.Add(maskedTextBox); + panelCompanyTools.Controls.Add(buttonRefresh); + panelCompanyTools.Controls.Add(ButtonDelAirplan); + panelCompanyTools.Controls.Add(buttonGoToCheck); + panelCompanyTools.Enabled = false; + panelCompanyTools.Location = new Point(3, 400); + panelCompanyTools.Name = "panelCompanyTools"; + panelCompanyTools.Size = new Size(207, 307); + panelCompanyTools.TabIndex = 9; + // // FormAirplanCollection // AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1070, 617); + ClientSize = new Size(1135, 707); Controls.Add(pictureBox); Controls.Add(groupBoxTools); Name = "FormAirplanCollection"; Text = "Коллекция самолётов"; groupBoxTools.ResumeLayout(false); - groupBoxTools.PerformLayout(); + panelStorage.ResumeLayout(false); + panelStorage.PerformLayout(); ((System.ComponentModel.ISupportInitialize)pictureBox).EndInit(); + panelCompanyTools.ResumeLayout(false); + panelCompanyTools.PerformLayout(); ResumeLayout(false); } @@ -164,5 +282,15 @@ private PictureBox pictureBox; private Button buttonRefresh; private Button buttonGoToCheck; + private Panel panelStorage; + private TextBox textBoxCollectionName; + private Label labelCollectionName; + private RadioButton radioButtonMassive; + private Button buttonCollectionDel; + private ListBox listBoxCollection; + private Button buttonCollectionAdd; + private RadioButton radioButtonList; + private Button buttonCreateToCompany; + private Panel panelCompanyTools; } } \ No newline at end of file diff --git a/Project_airbus/Project_airbus/FormAirplanCollection.cs b/Project_airbus/Project_airbus/FormAirplanCollection.cs index f8f1650..9f03aec 100644 --- a/Project_airbus/Project_airbus/FormAirplanCollection.cs +++ b/Project_airbus/Project_airbus/FormAirplanCollection.cs @@ -8,6 +8,11 @@ namespace Project_airbus; /// public partial class FormAirplanCollection : Form { + /// + /// Хранилише коллекций + /// + private readonly StorageCollection _storageCollection; + /// /// Компания /// @@ -19,6 +24,7 @@ public partial class FormAirplanCollection : Form public FormAirplanCollection() { InitializeComponent(); + _storageCollection = new(); } /// @@ -28,12 +34,7 @@ public partial class FormAirplanCollection : Form /// private void ComboBoxSelectorCompany_SelectedIndexChanged(object sender, EventArgs e) { - switch (comboBoxSelectorCompany.Text) - { - case "Хранилище": - _company = new AirplanSharingService(pictureBox.Width, pictureBox.Height, new MassiveGenericObjects()); - break; - } + panelCompanyTools.Enabled = false; } /// @@ -183,4 +184,99 @@ public partial class FormAirplanCollection : 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(); + + } + + /// + /// Обновление списка в 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 buttonCollectionDel_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(); + } + + /// + /// Создание компании + /// + /// + /// + private void buttonCreateToCompany_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 AirplanSharingService(pictureBox.Width, pictureBox.Height, collection); + break; + } + + panelCompanyTools.Enabled = true; + RerfreshListBoxItems(); + } } \ No newline at end of file -- 2.25.1 From 97f085499903dac6d032540cf2db372dc143ff08 Mon Sep 17 00:00:00 2001 From: Evgehil Date: Mon, 18 Mar 2024 10:58:30 +0400 Subject: [PATCH 2/3] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=BD=D0=BE=D0=B9=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CollectionGenericObjects/ICollectionGenericObjects.cs | 8 +------- Project_airbus/Project_airbus/Drawings/DirectionType.cs | 8 +------- Project_airbus/Project_airbus/Drawings/DrawingAirbus.cs | 7 +------ Project_airbus/Project_airbus/Drawings/DrawingAirplan.cs | 7 +------ Project_airbus/Project_airbus/Entities/EntityAirplan.cs | 8 +------- 5 files changed, 5 insertions(+), 33 deletions(-) diff --git a/Project_airbus/Project_airbus/CollectionGenericObjects/ICollectionGenericObjects.cs b/Project_airbus/Project_airbus/CollectionGenericObjects/ICollectionGenericObjects.cs index cc38227..fcd5723 100644 --- a/Project_airbus/Project_airbus/CollectionGenericObjects/ICollectionGenericObjects.cs +++ b/Project_airbus/Project_airbus/CollectionGenericObjects/ICollectionGenericObjects.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Project_airbus.CollectionGenericObjects; +namespace Project_airbus.CollectionGenericObjects; /// /// Интерфейс описания действий для набора хранимых объектов diff --git a/Project_airbus/Project_airbus/Drawings/DirectionType.cs b/Project_airbus/Project_airbus/Drawings/DirectionType.cs index bd57169..5096096 100644 --- a/Project_airbus/Project_airbus/Drawings/DirectionType.cs +++ b/Project_airbus/Project_airbus/Drawings/DirectionType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Project_airbus.Drawings; +namespace Project_airbus.Drawings; /// /// Направление перемещения /// diff --git a/Project_airbus/Project_airbus/Drawings/DrawingAirbus.cs b/Project_airbus/Project_airbus/Drawings/DrawingAirbus.cs index dc37a0a..6360bf2 100644 --- a/Project_airbus/Project_airbus/Drawings/DrawingAirbus.cs +++ b/Project_airbus/Project_airbus/Drawings/DrawingAirbus.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Project_airbus.Entities; +using Project_airbus.Entities; namespace Project_airbus.Drawings; diff --git a/Project_airbus/Project_airbus/Drawings/DrawingAirplan.cs b/Project_airbus/Project_airbus/Drawings/DrawingAirplan.cs index 48537d1..8769601 100644 --- a/Project_airbus/Project_airbus/Drawings/DrawingAirplan.cs +++ b/Project_airbus/Project_airbus/Drawings/DrawingAirplan.cs @@ -1,9 +1,4 @@ using Project_airbus.Entities; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Project_airbus.Drawings; @@ -225,7 +220,7 @@ public class DrawingAirplan { return; } - Pen pen = new(Color.Black); + Pen pen = new Pen(EntityAirplan.BodyAirbus); //корпус g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 20, 100, 20); diff --git a/Project_airbus/Project_airbus/Entities/EntityAirplan.cs b/Project_airbus/Project_airbus/Entities/EntityAirplan.cs index f42c811..548cd6d 100644 --- a/Project_airbus/Project_airbus/Entities/EntityAirplan.cs +++ b/Project_airbus/Project_airbus/Entities/EntityAirplan.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Project_airbus.Entities; +namespace Project_airbus.Entities; /// /// Класс-сущность "Самолёт" -- 2.25.1 From 33559a2fa762024ec43b3b8a9aff5eba1aa9319e Mon Sep 17 00:00:00 2001 From: Evgehil Date: Mon, 18 Mar 2024 11:08:26 +0400 Subject: [PATCH 3/3] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CollectionGenericObjects/ListGenericObjects.cs | 1 - .../CollectionGenericObjects/MassiveGenericObjects.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/Project_airbus/Project_airbus/CollectionGenericObjects/ListGenericObjects.cs b/Project_airbus/Project_airbus/CollectionGenericObjects/ListGenericObjects.cs index 06f3670..76a4186 100644 --- a/Project_airbus/Project_airbus/CollectionGenericObjects/ListGenericObjects.cs +++ b/Project_airbus/Project_airbus/CollectionGenericObjects/ListGenericObjects.cs @@ -57,5 +57,4 @@ public class ListGenericObjects : ICollectionGenericObjects _collection.RemoveAt(position); return obj; } - } diff --git a/Project_airbus/Project_airbus/CollectionGenericObjects/MassiveGenericObjects.cs b/Project_airbus/Project_airbus/CollectionGenericObjects/MassiveGenericObjects.cs index 7cef140..11cc6c9 100644 --- a/Project_airbus/Project_airbus/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/Project_airbus/Project_airbus/CollectionGenericObjects/MassiveGenericObjects.cs @@ -61,7 +61,6 @@ public class MassiveGenericObjects : ICollectionGenericObjects return -1; } - public int Insert(T obj, int position) { if (position >= _collection.Length || position < 0) return -1; -- 2.25.1