Compare commits
No commits in common. "2fd3db0774756b8d15c1a2dff92f1bfb04b4d000" and "36a5f9721d419dd91c98d107f61b9ab6ede8e2b2" have entirely different histories.
2fd3db0774
...
36a5f9721d
@ -1,5 +1,4 @@
|
|||||||
using ProjectTrain.Drawnings;
|
using ProjectTrain.Drawnings;
|
||||||
using ProjectTrain.CollectionGenericObjects;
|
|
||||||
|
|
||||||
namespace ProjectTrain.CollectionGenericObjects
|
namespace ProjectTrain.CollectionGenericObjects
|
||||||
{
|
{
|
||||||
@ -15,23 +14,7 @@ namespace ProjectTrain.CollectionGenericObjects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private T?[] _collection;
|
private T?[] _collection;
|
||||||
public int Count => _collection.Length;
|
public int Count => _collection.Length;
|
||||||
public int SetMaxCount
|
public int SetMaxCount { set { if (value > 0) { _collection = new T?[value]; } } }
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value > 0)
|
|
||||||
{
|
|
||||||
if (_collection.Length > 0)
|
|
||||||
{
|
|
||||||
Array.Resize(ref _collection, value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_collection = new T?[value];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Конструктор
|
/// Конструктор
|
||||||
@ -44,10 +27,11 @@ namespace ProjectTrain.CollectionGenericObjects
|
|||||||
{
|
{
|
||||||
// TODO проверка позиции
|
// TODO проверка позиции
|
||||||
if (position >= _collection.Length || position < 0)
|
if (position >= _collection.Length || position < 0)
|
||||||
{ return null; }
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return _collection[position];
|
return _collection[position];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Insert(T obj)
|
public int Insert(T obj)
|
||||||
{
|
{
|
||||||
// TODO вставка в свободное место набора
|
// TODO вставка в свободное место набора
|
||||||
@ -59,12 +43,10 @@ namespace ProjectTrain.CollectionGenericObjects
|
|||||||
_collection[index] = obj;
|
_collection[index] = obj;
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Insert(T obj, int position)
|
public int Insert(T obj, int position)
|
||||||
{
|
{
|
||||||
// TODO проверка позиции
|
// TODO проверка позиции
|
||||||
@ -101,16 +83,15 @@ namespace ProjectTrain.CollectionGenericObjects
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public T Remove(int position)
|
public T Remove(int position)
|
||||||
{
|
{
|
||||||
// TODO проверка позиции
|
// TODO проверка позиции
|
||||||
// TODO удаление объекта из массива, присвоив элементу массива значение null
|
// TODO удаление объекта из массива, присвоив элементу массива значение null
|
||||||
if (position >= _collection.Length || position < 0)
|
if (position >= _collection.Length || position < 0)
|
||||||
{ return null; }
|
{ return null; }
|
||||||
T obj = _collection[position];
|
T drawningTrain = _collection[position];
|
||||||
_collection[position] = null;
|
_collection[position] = null;
|
||||||
return obj;
|
return drawningTrain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
groupBoxTools.Controls.Add(comboBoxSelectorCompany);
|
groupBoxTools.Controls.Add(comboBoxSelectorCompany);
|
||||||
groupBoxTools.Controls.Add(panelCompanyTools);
|
groupBoxTools.Controls.Add(panelCompanyTools);
|
||||||
groupBoxTools.Dock = DockStyle.Right;
|
groupBoxTools.Dock = DockStyle.Right;
|
||||||
groupBoxTools.Location = new Point(558, 0);
|
groupBoxTools.Location = new Point(510, 0);
|
||||||
groupBoxTools.Margin = new Padding(3, 2, 3, 2);
|
groupBoxTools.Margin = new Padding(3, 2, 3, 2);
|
||||||
groupBoxTools.Name = "groupBoxTools";
|
groupBoxTools.Name = "groupBoxTools";
|
||||||
groupBoxTools.Padding = new Padding(3, 2, 3, 2);
|
groupBoxTools.Padding = new Padding(3, 2, 3, 2);
|
||||||
@ -273,7 +273,7 @@
|
|||||||
pictureBoxTrain.Location = new Point(0, 0);
|
pictureBoxTrain.Location = new Point(0, 0);
|
||||||
pictureBoxTrain.Margin = new Padding(3, 2, 3, 2);
|
pictureBoxTrain.Margin = new Padding(3, 2, 3, 2);
|
||||||
pictureBoxTrain.Name = "pictureBoxTrain";
|
pictureBoxTrain.Name = "pictureBoxTrain";
|
||||||
pictureBoxTrain.Size = new Size(558, 490);
|
pictureBoxTrain.Size = new Size(510, 490);
|
||||||
pictureBoxTrain.TabIndex = 1;
|
pictureBoxTrain.TabIndex = 1;
|
||||||
pictureBoxTrain.TabStop = false;
|
pictureBoxTrain.TabStop = false;
|
||||||
//
|
//
|
||||||
@ -281,7 +281,7 @@
|
|||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(752, 490);
|
ClientSize = new Size(704, 490);
|
||||||
Controls.Add(pictureBoxTrain);
|
Controls.Add(pictureBoxTrain);
|
||||||
Controls.Add(groupBoxTools);
|
Controls.Add(groupBoxTools);
|
||||||
Margin = new Padding(3, 2, 3, 2);
|
Margin = new Padding(3, 2, 3, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user