Эстетические рпавки во второй форме

This commit is contained in:
Софья Якобчук 2023-11-28 07:04:12 +04:00
parent b5614f7497
commit 895f7fd63a
3 changed files with 13 additions and 47 deletions

View File

@ -31,11 +31,11 @@ namespace Sailboat.Generics
/// <summary>
/// Размер занимаемого объектом места (ширина)
/// </summary>
private readonly int _placeSizeWidth = 160;
private readonly int _placeSizeWidth = 200;
/// <summary>
/// Размер занимаемого объектом места (высота)
/// </summary>
private readonly int _placeSizeHeight = 160;
private readonly int _placeSizeHeight = 170;
/// <summary>
/// Набор объектов
/// </summary>

View File

@ -40,10 +40,10 @@
//
// pictureBoxCollection
//
pictureBoxCollection.Dock = DockStyle.Fill;
pictureBoxCollection.Location = new Point(0, 0);
pictureBoxCollection.Name = "pictureBoxCollection";
pictureBoxCollection.Size = new Size(800, 450);
pictureBoxCollection.Size = new Size(750, 450);
pictureBoxCollection.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBoxCollection.TabIndex = 0;
pictureBoxCollection.TabStop = false;
//
@ -51,7 +51,7 @@
//
buttonAddBoat.Location = new Point(6, 26);
buttonAddBoat.Name = "buttonAddBoat";
buttonAddBoat.Size = new Size(238, 45);
buttonAddBoat.Size = new Size(197, 45);
buttonAddBoat.TabIndex = 1;
buttonAddBoat.Text = "Добавить лодку";
buttonAddBoat.UseVisualStyleBackColor = true;
@ -61,7 +61,7 @@
//
buttonRemoveBoat.Location = new Point(6, 145);
buttonRemoveBoat.Name = "buttonRemoveBoat";
buttonRemoveBoat.Size = new Size(238, 45);
buttonRemoveBoat.Size = new Size(197, 45);
buttonRemoveBoat.TabIndex = 2;
buttonRemoveBoat.Text = "Удалить лодку";
buttonRemoveBoat.UseVisualStyleBackColor = true;
@ -71,7 +71,7 @@
//
buttonRefreshCollection.Location = new Point(6, 227);
buttonRefreshCollection.Name = "buttonRefreshCollection";
buttonRefreshCollection.Size = new Size(238, 45);
buttonRefreshCollection.Size = new Size(197, 45);
buttonRefreshCollection.TabIndex = 3;
buttonRefreshCollection.Text = "Обновить коллекцию";
buttonRefreshCollection.UseVisualStyleBackColor = true;
@ -79,9 +79,9 @@
//
// maskedTextBoxNumber
//
maskedTextBoxNumber.Location = new Point(69, 112);
maskedTextBoxNumber.Location = new Point(34, 112);
maskedTextBoxNumber.Name = "maskedTextBoxNumber";
maskedTextBoxNumber.Size = new Size(125, 27);
maskedTextBoxNumber.Size = new Size(138, 27);
maskedTextBoxNumber.TabIndex = 4;
//
// groupBoxTools
@ -90,9 +90,9 @@
groupBoxTools.Controls.Add(buttonRefreshCollection);
groupBoxTools.Controls.Add(maskedTextBoxNumber);
groupBoxTools.Controls.Add(buttonRemoveBoat);
groupBoxTools.Location = new Point(538, 12);
groupBoxTools.Location = new Point(756, 12);
groupBoxTools.Name = "groupBoxTools";
groupBoxTools.Size = new Size(250, 426);
groupBoxTools.Size = new Size(209, 387);
groupBoxTools.TabIndex = 2;
groupBoxTools.TabStop = false;
groupBoxTools.Text = "Инструменты";
@ -101,7 +101,7 @@
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
ClientSize = new Size(973, 403);
Controls.Add(groupBoxTools);
Controls.Add(pictureBoxCollection);
Name = "FormBoatCollection";
@ -110,6 +110,7 @@
groupBoxTools.ResumeLayout(false);
groupBoxTools.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
#endregion

View File

@ -6,43 +6,18 @@ using System.Threading.Tasks;
namespace Sailboat.Generics
{
/// <summary>
/// Параметризованный набор объектов
/// </summary>
/// <typeparam name="T"></typeparam>
internal class SetGeneric<T> where T : class
{
/// <summary>
/// Массив объектов, которые храним
/// </summary>
private readonly T?[] _places;
/// <summary>
/// Количество объектов в массиве
/// </summary>
public int Count => _places.Length;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="count"></param>
public SetGeneric(int count)
{
_places = new T?[count];
}
/// <summary>
/// Добавление объекта в набор
/// </summary>
/// <param name="boat">Добавляемая лодка</param>
/// <returns></returns>
public int Insert(T boat)
{
return Insert(boat, 0);
}
/// <summary>
/// Добавление объекта в набор на конкретную позицию
/// </summary>
/// <param name="boat">Добавляемая лодка</param>
/// <param name="position">Позиция</param>
/// <returns></returns>
public int Insert(T boat, int position)
{
int nullIndex = -1, i;
@ -74,11 +49,6 @@ namespace Sailboat.Generics
_places[position] = boat;
return position;
}
/// <summary>
/// Удаление объекта из набора с конкретной позиции
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
public bool Remove(int position)
{
if (position < 0 || position >= Count)
@ -89,11 +59,6 @@ namespace Sailboat.Generics
_places[position] = null;
return true;
}
/// <summary>
/// Получение объекта из набора по позиции
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
public T? Get(int position)
{
if (position < 0 || position >= Count)