From bd6f7fb3f31d2a1f9b2f06984956b498c9d3c610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=93=D0=BE=D1=80=D0=B4?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2?= <89176335310x@gmail.com> Date: Sat, 18 Nov 2023 21:02:08 +0400 Subject: [PATCH 1/3] Problem draw collection --- .../FormLocomotiveCollection.Designer.cs | 88 ++++++++++++--- .../FormLocomotiveCollection.cs | 100 +++++++++++++++--- .../LocomotiveGenericStorage.cs | 82 ++++++++++++++ .../LocomotivesGenericCollection.cs | 46 ++++---- .../ElectricLocomotive/SetGeneric.cs | 82 +++++++------- 5 files changed, 311 insertions(+), 87 deletions(-) create mode 100644 ElectricLocomotive/ElectricLocomotive/LocomotiveGenericStorage.cs diff --git a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.Designer.cs b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.Designer.cs index 0035c81..64686c6 100644 --- a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.Designer.cs +++ b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.Designer.cs @@ -30,77 +30,134 @@ { CollectionPictureBox = new PictureBox(); ToolsBox = new GroupBox(); + NaborGroupBox = new GroupBox(); + ButtomRemoveNabor = new Button(); + listBoxStorage = new ListBox(); + AddNabor = new Button(); + textBoxStorageName = new TextBox(); Input = new TextBox(); RefreshCollection = new Button(); DelLocomotive = new Button(); AddLocomotive = new Button(); ((System.ComponentModel.ISupportInitialize)CollectionPictureBox).BeginInit(); ToolsBox.SuspendLayout(); + NaborGroupBox.SuspendLayout(); SuspendLayout(); // // CollectionPictureBox // CollectionPictureBox.Location = new Point(3, 0); CollectionPictureBox.Name = "CollectionPictureBox"; - CollectionPictureBox.Size = new Size(634, 457); + CollectionPictureBox.Size = new Size(696, 554); CollectionPictureBox.TabIndex = 0; CollectionPictureBox.TabStop = false; // // ToolsBox // + ToolsBox.Controls.Add(NaborGroupBox); ToolsBox.Controls.Add(Input); ToolsBox.Controls.Add(RefreshCollection); ToolsBox.Controls.Add(DelLocomotive); ToolsBox.Controls.Add(AddLocomotive); - ToolsBox.Location = new Point(643, 0); + ToolsBox.Location = new Point(705, 12); ToolsBox.Name = "ToolsBox"; - ToolsBox.Size = new Size(200, 457); + ToolsBox.Size = new Size(200, 542); ToolsBox.TabIndex = 1; ToolsBox.TabStop = false; ToolsBox.Text = "Инструменты"; // + // NaborGroupBox + // + NaborGroupBox.Controls.Add(ButtomRemoveNabor); + NaborGroupBox.Controls.Add(listBoxStorage); + NaborGroupBox.Controls.Add(AddNabor); + NaborGroupBox.Controls.Add(textBoxStorageName); + NaborGroupBox.Location = new Point(7, 22); + NaborGroupBox.Name = "NaborGroupBox"; + NaborGroupBox.Size = new Size(185, 329); + NaborGroupBox.TabIndex = 4; + NaborGroupBox.TabStop = false; + NaborGroupBox.Text = "Наборы"; + // + // ButtomRemoveNabor + // + ButtomRemoveNabor.Location = new Point(6, 275); + ButtomRemoveNabor.Name = "ButtomRemoveNabor"; + ButtomRemoveNabor.Size = new Size(173, 48); + ButtomRemoveNabor.TabIndex = 3; + ButtomRemoveNabor.Text = "Удалить набор"; + ButtomRemoveNabor.UseVisualStyleBackColor = true; + ButtomRemoveNabor.Click += ButtonRemoveObject_Click; + // + // listBoxStorage + // + listBoxStorage.FormattingEnabled = true; + listBoxStorage.ItemHeight = 15; + listBoxStorage.Location = new Point(6, 112); + listBoxStorage.Name = "listBoxStorage"; + listBoxStorage.Size = new Size(173, 139); + listBoxStorage.TabIndex = 2; + listBoxStorage.SelectedIndexChanged += listBoxStorage_SelectedIndexChanged; + // + // AddNabor + // + AddNabor.Location = new Point(6, 63); + AddNabor.Name = "AddNabor"; + AddNabor.Size = new Size(173, 43); + AddNabor.TabIndex = 1; + AddNabor.Text = "Добавить набор"; + AddNabor.UseVisualStyleBackColor = true; + AddNabor.Click += ButtonAddObject_Click; + // + // textBoxStorageName + // + textBoxStorageName.Location = new Point(6, 34); + textBoxStorageName.Name = "textBoxStorageName"; + textBoxStorageName.Size = new Size(173, 23); + textBoxStorageName.TabIndex = 0; + // // Input // - Input.Location = new Point(7, 91); + Input.Location = new Point(6, 409); Input.Name = "Input"; Input.Size = new Size(186, 23); Input.TabIndex = 3; // // RefreshCollection // - RefreshCollection.Location = new Point(7, 240); + RefreshCollection.Location = new Point(7, 490); RefreshCollection.Name = "RefreshCollection"; RefreshCollection.Size = new Size(187, 46); RefreshCollection.TabIndex = 2; - RefreshCollection.Text = "Обновить коллекцию"; + RefreshCollection.Text = "Обновить все"; RefreshCollection.UseVisualStyleBackColor = true; - RefreshCollection.Click += refreshCollection_Click; + RefreshCollection.Click += ButtonRefreshCollection_Click; // // DelLocomotive // - DelLocomotive.Location = new Point(7, 134); + DelLocomotive.Location = new Point(6, 438); DelLocomotive.Name = "DelLocomotive"; DelLocomotive.Size = new Size(187, 46); DelLocomotive.TabIndex = 1; DelLocomotive.Text = "Удалить локомотив"; DelLocomotive.UseVisualStyleBackColor = true; - DelLocomotive.Click += deleteLoco_Click; + DelLocomotive.Click += ButtonRemoveLocomotive_Click; // // AddLocomotive // - AddLocomotive.Location = new Point(6, 22); + AddLocomotive.Location = new Point(5, 357); AddLocomotive.Name = "AddLocomotive"; AddLocomotive.Size = new Size(187, 46); AddLocomotive.TabIndex = 0; AddLocomotive.Text = "Добавить локомотив"; AddLocomotive.UseVisualStyleBackColor = true; - AddLocomotive.Click += addLocomotiv_Click; + AddLocomotive.Click += ButtonAddLocomotive_Click; // // FormLocomotiveCollection // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(848, 469); + ClientSize = new Size(917, 566); Controls.Add(ToolsBox); Controls.Add(CollectionPictureBox); Name = "FormLocomotiveCollection"; @@ -108,6 +165,8 @@ ((System.ComponentModel.ISupportInitialize)CollectionPictureBox).EndInit(); ToolsBox.ResumeLayout(false); ToolsBox.PerformLayout(); + NaborGroupBox.ResumeLayout(false); + NaborGroupBox.PerformLayout(); ResumeLayout(false); } @@ -119,5 +178,10 @@ private Button RefreshCollection; private Button DelLocomotive; private Button AddLocomotive; + private GroupBox NaborGroupBox; + private Button AddNabor; + private TextBox textBoxStorageName; + private Button ButtomRemoveNabor; + private ListBox listBoxStorage; } } \ No newline at end of file diff --git a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.cs b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.cs index 08b0892..7ca944b 100644 --- a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.cs +++ b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.cs @@ -14,22 +14,86 @@ namespace ElectricLocomotive { public partial class FormLocomotiveCollection : Form { - private readonly LocomotivesGenericCollection _locos; + + private readonly LocomotiveGenericStorage _storage; + //private readonly LocomotiveGenericCollection _locomotives; public FormLocomotiveCollection() { InitializeComponent(); - _locos = new(CollectionPictureBox.Width, CollectionPictureBox.Height); + _storage = new LocomotiveGenericStorage(CollectionPictureBox.Width, CollectionPictureBox.Height); } - private void addLocomotiv_Click(object sender, EventArgs e) + /// + /// Заполнение listBoxObjects + /// + private void ReloadObjects() { + int index = listBoxStorage.SelectedIndex; + + listBoxStorage.Items.Clear(); + for (int i = 0; i < _storage.Keys.Count; i++) + { + listBoxStorage.Items.Add(_storage.Keys[i]); + } + if (listBoxStorage.Items.Count > 0 && (index == -1 || index >= listBoxStorage.Items.Count)) + { + listBoxStorage.SelectedIndex = 0; + } + else if (listBoxStorage.Items.Count > 0 && index > -1 && index < listBoxStorage.Items.Count) + { + listBoxStorage.SelectedIndex = index; + } + } + + private void ButtonAddObject_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(textBoxStorageName.Text)) + { + MessageBox.Show("Не всё заполнено", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + _storage.AddSet(textBoxStorageName.Text); + ReloadObjects(); + } + + private void listBoxStorage_SelectedIndexChanged(object sender, EventArgs e) + { + CollectionPictureBox.Image = _storage[listBoxStorage.SelectedItem?.ToString() ?? string.Empty]?.ShowLocomotives(); + } + + private void ButtonRemoveObject_Click(object sender, EventArgs e) + { + if (listBoxStorage.SelectedIndex == -1) + { + return; + } + if (MessageBox.Show($"Удалить объект {listBoxStorage.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, + MessageBoxIcon.Question) == DialogResult.Yes) + { + _storage.DelSet(listBoxStorage.SelectedItem.ToString() ?? string.Empty); + ReloadObjects(); + } + } + + private void ButtonAddLocomotive_Click(object sender, EventArgs e) + { + + if (listBoxStorage.SelectedIndex == -1) return; + + var obj = _storage[listBoxStorage.SelectedItem.ToString() ?? string.Empty]; + if (obj == null) + { + return; + } + ElectricLocomotive form = new(); if (form.ShowDialog() == DialogResult.OK) { - if (_locos + form.SelectedLocomotive != null) + //проверяем, удалось ли нам загрузить объект + if (obj + form.SelectedLocomotive > -1) { MessageBox.Show("Объект добавлен"); - CollectionPictureBox.Image = _locos.ShowLocomotives(); + CollectionPictureBox.Image = obj.ShowLocomotives(); } else { @@ -38,17 +102,24 @@ namespace ElectricLocomotive } } - private void deleteLoco_Click(object sender, EventArgs e) + private void ButtonRemoveLocomotive_Click(object sender, EventArgs e) { + if (listBoxStorage.SelectedIndex == -1) return; + var obj = _storage[listBoxStorage.SelectedItem.ToString() ?? string.Empty]; + if (obj == null) + { + return; + } + if (MessageBox.Show("Удалить объект?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } int pos = Convert.ToInt32(Input.Text); - if (_locos - pos != null) + if (obj - pos != null) { MessageBox.Show("Объект удален"); - CollectionPictureBox.Image = _locos.ShowLocomotives(); + CollectionPictureBox.Image = obj.ShowLocomotives(); } else { @@ -56,10 +127,15 @@ namespace ElectricLocomotive } } - private void refreshCollection_Click(object sender, EventArgs e) + private void ButtonRefreshCollection_Click(object sender, EventArgs e) { - CollectionPictureBox.Image = _locos.ShowLocomotives(); - + if (listBoxStorage.SelectedIndex == -1) return; + var obj = _storage[listBoxStorage.SelectedItem.ToString() ?? string.Empty]; + if (obj == null) + { + return; + } + CollectionPictureBox.Image = obj.ShowLocomotives(); } } -} +} \ No newline at end of file diff --git a/ElectricLocomotive/ElectricLocomotive/LocomotiveGenericStorage.cs b/ElectricLocomotive/ElectricLocomotive/LocomotiveGenericStorage.cs new file mode 100644 index 0000000..18614ed --- /dev/null +++ b/ElectricLocomotive/ElectricLocomotive/LocomotiveGenericStorage.cs @@ -0,0 +1,82 @@ +using ElectricLocomotive.DrawningObject; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ElectricLocomotive.Generics +{ + internal class LocomotiveGenericStorage + { + /// + /// Словарь (хранилище) + /// + readonly Dictionary> _locomotivesStorage; + + /// + /// Возвращение списка названий наборов + /// + public List Keys => _locomotivesStorage.Keys.ToList(); + + + private readonly int _pictureWidth; + + private readonly int _pictureHeight; + + /// + /// Конструктор + /// + /// + /// + public LocomotiveGenericStorage(int pictureWidth, int pictureHeight) + { + _locomotivesStorage = new Dictionary>(); + _pictureWidth = pictureWidth; + _pictureHeight = pictureHeight; + } + /// + /// Добавление набора + /// + /// Название набора + public void AddSet(string name) + { + if (!_locomotivesStorage.ContainsKey(name)) + { + _locomotivesStorage.Add(name, new LocomotivesGenericCollection(_pictureWidth, _pictureHeight)); + } + } + + /// + /// Удаление набора + /// + /// Название набора + public void DelSet(string name) + { + if (_locomotivesStorage.ContainsKey(name)) + { + _locomotivesStorage.Remove(name); + } + } + + + /// + /// Доступ к набору + /// + /// + /// + public LocomotivesGenericCollection? + this[string ind] + { + get + { + // TODO Продумать логику получения набора + if (_locomotivesStorage.ContainsKey(ind)) + { + return _locomotivesStorage[ind]; + } + return null; + } + } + } +} diff --git a/ElectricLocomotive/ElectricLocomotive/LocomotivesGenericCollection.cs b/ElectricLocomotive/ElectricLocomotive/LocomotivesGenericCollection.cs index edc48ae..dd3ad2d 100644 --- a/ElectricLocomotive/ElectricLocomotive/LocomotivesGenericCollection.cs +++ b/ElectricLocomotive/ElectricLocomotive/LocomotivesGenericCollection.cs @@ -17,6 +17,7 @@ namespace ElectricLocomotive.Generics private readonly int _pictureHeight; private readonly int _placeSizeWidth = 200; private readonly int _placeSizeHeight = 90; + private readonly SetGeneric _collection; public LocomotivesGenericCollection(int picWidth, int picHeight) { @@ -26,24 +27,29 @@ namespace ElectricLocomotive.Generics _pictureHeight = picHeight; _collection = new SetGeneric(width * height); } - public static int operator +(LocomotivesGenericCollection collect, T? locomotive) + public static int operator +(LocomotivesGenericCollection collect, T? loco) { - if (locomotive == null) + if (loco == null) { return -1; } - return collect?._collection.Insert(locomotive) ?? -1; + return collect._collection.Insert(loco); } - public static bool operator -(LocomotivesGenericCollection collect, int pos) + + + /// Перегрузка оператора вычитания + public static T? operator -(LocomotivesGenericCollection collect, int pos) { - T? locomotive = collect._collection.Get(pos); - if (locomotive != null) - return collect._collection.Remove(pos); - return false; + T? obj = collect._collection[pos]; + if (obj != null) + { + collect._collection.Remove(pos); + } + return obj; } public U? GetU(int pos) { - return (U?)_collection.Get(pos)?.GetMoveableObject; + return (U?)_collection[pos]?.GetMoveableObject; } public Bitmap ShowLocomotives() { @@ -58,30 +64,26 @@ namespace ElectricLocomotive.Generics Pen pen = new(Color.Black, 3); for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++) { - for (int j = 0; j < _pictureHeight / _placeSizeHeight + - 1; ++j) + for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j) { - g.DrawLine(pen, i * _placeSizeWidth, j * - _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j * - _placeSizeHeight); + //линия рамзетки места + g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight); } - g.DrawLine(pen, i * _placeSizeWidth, 0, i * - _placeSizeWidth, _pictureHeight / _placeSizeHeight * _placeSizeHeight); + g.DrawLine(pen, i * _placeSizeWidth, 0, i * _placeSizeWidth, _pictureHeight / _placeSizeHeight * _placeSizeHeight); } } private void DrawObjects(Graphics g) { - int HLoco = _pictureHeight / _placeSizeHeight; - int Wloco = _pictureWidth / _placeSizeWidth; + int HeightObjCount = _pictureHeight / _placeSizeHeight; + int WidthObjCount = _pictureWidth / _placeSizeWidth; for (int i = 0; i < _collection.Count; i++) { - T? type = _collection.Get(i); + T? type = _collection[i]; if (type != null) { type.SetPosition( - (int)(i / HLoco * _placeSizeWidth), - (HLoco - 1) * _placeSizeHeight - (int)(i % HLoco * _placeSizeHeight) - ); + (int)(i / HeightObjCount * _placeSizeWidth), + (HeightObjCount - 1) * _placeSizeHeight - (int)(i % HeightObjCount * _placeSizeHeight)); type?.DrawTransport(g); } } diff --git a/ElectricLocomotive/ElectricLocomotive/SetGeneric.cs b/ElectricLocomotive/ElectricLocomotive/SetGeneric.cs index 60c65ce..8c310ef 100644 --- a/ElectricLocomotive/ElectricLocomotive/SetGeneric.cs +++ b/ElectricLocomotive/ElectricLocomotive/SetGeneric.cs @@ -6,60 +6,60 @@ using System.Threading.Tasks; namespace ProjectElectricLocomotive.Generics { - internal class SetGeneric - where T : class + internal class SetGeneric where T : class { - private readonly T?[] _places; - public int Count => _places.Length; + private readonly List _places; + public int Count => _places.Count; + /// Максимальное количество объектов в списке + private readonly int _maxCount; public SetGeneric(int count) { - _places = new T?[count]; + _maxCount = count; + _places = new List(count); } - public int Insert(T locomotive) + public int Insert(T loco) { - return Insert(locomotive, 0); + return Insert(loco, 0); } - public int Insert(T locomotive, int position) + + public int Insert(T loco, int position) { - int Full = 0; - int temp = 0; - for (int i = position; i < Count; i++) - { - if (_places[i] != null) Full++; - } - if (Full == Count - position - 1) - return -1; - if (position < Count && position >= 0) - { - for (int j = position; j < Count; j++) - { - if (_places[j] == null) - { - temp = j; - break; - } - } - for (int i = temp; i > position; i--) - { - _places[i] = _places[i - 1]; - } - _places[position] = locomotive; - return position; - } - return -1; + if (position < 0 || position >= _maxCount) return -1; + _places.Insert(position, loco); + return position; } - public bool Remove(int position) + public T? Remove(int position) { if (position >= Count || position < 0) - if (!(position >= 0 && position < Count) || _places[position] == null) - return false; + return null; + + T? tmp = _places[position]; _places[position] = null; - return true; + return tmp; } - public T Get(int position) + public T? this[int position] { - if (position < 0 || position >= Count) return null; - return _places[position]; + get + { + if (position < 0 || position >= Count) return null; + return _places[position]; + } + set + { + if (position < 0 || position >= Count || Count == _maxCount) return; + _places.Insert(position, value); + } + } + public IEnumerable GetLocomotives(int? maxLocos = null) + { + for (int i = 0; i < _places.Count; ++i) + { + yield return _places[i]; + if (maxLocos.HasValue && i == maxLocos.Value) + { + yield break; + } + } } } } -- 2.25.1 From bf4f0f98815792bdd2694a95f7e9739c8613d232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=93=D0=BE=D1=80=D0=B4?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2?= <89176335310x@gmail.com> Date: Sat, 18 Nov 2023 21:21:57 +0400 Subject: [PATCH 2/3] Probl old --- .../ElectricLocomotive/FormLocomotiveCollection.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.cs b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.cs index 7ca944b..9fd61dc 100644 --- a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.cs +++ b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.cs @@ -16,7 +16,6 @@ namespace ElectricLocomotive { private readonly LocomotiveGenericStorage _storage; - //private readonly LocomotiveGenericCollection _locomotives; public FormLocomotiveCollection() { InitializeComponent(); -- 2.25.1 From 8905614a0d08d10305927872cd3f1af442d3ddc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=93=D0=BE=D1=80=D0=B4?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2?= <89176335310x@gmail.com> Date: Fri, 1 Dec 2023 11:51:10 +0400 Subject: [PATCH 3/3] =?UTF-8?q?=D0=A1=D0=B4=D0=B0=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ElectricLocomotive/DrawningLocomotive.cs | 1 - .../FormLocomotiveCollection.Designer.cs | 20 +++++++++---------- .../LocomotiveGenericStorage.cs | 3 --- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/ElectricLocomotive/ElectricLocomotive/DrawningLocomotive.cs b/ElectricLocomotive/ElectricLocomotive/DrawningLocomotive.cs index ef15a0e..1215a6f 100644 --- a/ElectricLocomotive/ElectricLocomotive/DrawningLocomotive.cs +++ b/ElectricLocomotive/ElectricLocomotive/DrawningLocomotive.cs @@ -207,7 +207,6 @@ namespace ElectricLocomotive.DrawningObject DirectionType.Down => _startPosY + EntityLocomotive.Step < _pictureHeight, }; } - public IMoveableObject GetMoveableObject => new DrawningObjectLocomotive(this); } } diff --git a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.Designer.cs b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.Designer.cs index 64686c6..a3f1ed2 100644 --- a/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.Designer.cs +++ b/ElectricLocomotive/ElectricLocomotive/FormLocomotiveCollection.Designer.cs @@ -48,7 +48,7 @@ // CollectionPictureBox.Location = new Point(3, 0); CollectionPictureBox.Name = "CollectionPictureBox"; - CollectionPictureBox.Size = new Size(696, 554); + CollectionPictureBox.Size = new Size(696, 501); CollectionPictureBox.TabIndex = 0; CollectionPictureBox.TabStop = false; // @@ -61,7 +61,7 @@ ToolsBox.Controls.Add(AddLocomotive); ToolsBox.Location = new Point(705, 12); ToolsBox.Name = "ToolsBox"; - ToolsBox.Size = new Size(200, 542); + ToolsBox.Size = new Size(200, 489); ToolsBox.TabIndex = 1; ToolsBox.TabStop = false; ToolsBox.Text = "Инструменты"; @@ -74,14 +74,14 @@ NaborGroupBox.Controls.Add(textBoxStorageName); NaborGroupBox.Location = new Point(7, 22); NaborGroupBox.Name = "NaborGroupBox"; - NaborGroupBox.Size = new Size(185, 329); + NaborGroupBox.Size = new Size(185, 274); NaborGroupBox.TabIndex = 4; NaborGroupBox.TabStop = false; NaborGroupBox.Text = "Наборы"; // // ButtomRemoveNabor // - ButtomRemoveNabor.Location = new Point(6, 275); + ButtomRemoveNabor.Location = new Point(6, 212); ButtomRemoveNabor.Name = "ButtomRemoveNabor"; ButtomRemoveNabor.Size = new Size(173, 48); ButtomRemoveNabor.TabIndex = 3; @@ -95,7 +95,7 @@ listBoxStorage.ItemHeight = 15; listBoxStorage.Location = new Point(6, 112); listBoxStorage.Name = "listBoxStorage"; - listBoxStorage.Size = new Size(173, 139); + listBoxStorage.Size = new Size(173, 94); listBoxStorage.TabIndex = 2; listBoxStorage.SelectedIndexChanged += listBoxStorage_SelectedIndexChanged; // @@ -118,14 +118,14 @@ // // Input // - Input.Location = new Point(6, 409); + Input.Location = new Point(7, 354); Input.Name = "Input"; Input.Size = new Size(186, 23); Input.TabIndex = 3; // // RefreshCollection // - RefreshCollection.Location = new Point(7, 490); + RefreshCollection.Location = new Point(7, 435); RefreshCollection.Name = "RefreshCollection"; RefreshCollection.Size = new Size(187, 46); RefreshCollection.TabIndex = 2; @@ -135,7 +135,7 @@ // // DelLocomotive // - DelLocomotive.Location = new Point(6, 438); + DelLocomotive.Location = new Point(7, 383); DelLocomotive.Name = "DelLocomotive"; DelLocomotive.Size = new Size(187, 46); DelLocomotive.TabIndex = 1; @@ -145,7 +145,7 @@ // // AddLocomotive // - AddLocomotive.Location = new Point(5, 357); + AddLocomotive.Location = new Point(5, 302); AddLocomotive.Name = "AddLocomotive"; AddLocomotive.Size = new Size(187, 46); AddLocomotive.TabIndex = 0; @@ -157,7 +157,7 @@ // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(917, 566); + ClientSize = new Size(910, 507); Controls.Add(ToolsBox); Controls.Add(CollectionPictureBox); Name = "FormLocomotiveCollection"; diff --git a/ElectricLocomotive/ElectricLocomotive/LocomotiveGenericStorage.cs b/ElectricLocomotive/ElectricLocomotive/LocomotiveGenericStorage.cs index 18614ed..a996ed9 100644 --- a/ElectricLocomotive/ElectricLocomotive/LocomotiveGenericStorage.cs +++ b/ElectricLocomotive/ElectricLocomotive/LocomotiveGenericStorage.cs @@ -46,7 +46,6 @@ namespace ElectricLocomotive.Generics _locomotivesStorage.Add(name, new LocomotivesGenericCollection(_pictureWidth, _pictureHeight)); } } - /// /// Удаление набора /// @@ -58,8 +57,6 @@ namespace ElectricLocomotive.Generics _locomotivesStorage.Remove(name); } } - - /// /// Доступ к набору /// -- 2.25.1