почтии
This commit is contained in:
parent
d1ad010777
commit
ea6a49ba00
@ -39,12 +39,9 @@ namespace HoistingCrane.CollectionGenericObjects
|
||||
public T? Get(int position)
|
||||
{
|
||||
// TODO проверка позиции
|
||||
if(position >= 0 && position < _maxCount)
|
||||
{
|
||||
if (position >= Count || position < 0) return null;
|
||||
return list[position];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public int Insert(T obj)
|
||||
@ -70,10 +67,7 @@ namespace HoistingCrane.CollectionGenericObjects
|
||||
}
|
||||
list.Insert(position, obj);
|
||||
return position;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public T? Remove(int position)
|
||||
{
|
||||
// TODO проверка позиции
|
||||
|
@ -60,5 +60,4 @@ namespace HoistingCrane.CollectionGenericObjects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -64,9 +64,29 @@ namespace HoistingCrane
|
||||
}
|
||||
return color;
|
||||
}
|
||||
private void buttonCreateHoistingCrane_Click(object sender, EventArgs e) => CreateObject(nameof(DrawningHoistingCrane));
|
||||
private void buttonCreateHoistingCrane_Click(object sender, EventArgs e)
|
||||
{
|
||||
FormCarConfig form = new();
|
||||
form.Show();
|
||||
form.AddEvent(SetCar);
|
||||
}
|
||||
private void SetCar(DrawningTrackedVehicle drawningTrackedVehicle)
|
||||
{
|
||||
if (_company == null || drawningTrackedVehicle == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
private void buttonCreateTrackedVehicle_Click(object sender, EventArgs e) => CreateObject(nameof(DrawningTrackedVehicle));
|
||||
if (_company + drawningTrackedVehicle != -1)
|
||||
{
|
||||
MessageBox.Show("Объект добавлен");
|
||||
pictureBox.Image = _company.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Не удалось добавить объект");
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonDeleteCar_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -117,12 +117,11 @@ namespace HoistingCrane
|
||||
/// <param name="e"></param>
|
||||
private void labelBodyColor_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
if (car != null)
|
||||
{
|
||||
if (car == null)
|
||||
return;
|
||||
car.EntityTrackedVehicle?.SetBodyColor((Color)e.Data.GetData(typeof(Color)));
|
||||
DrawObject();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Передача основного цвета
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user