Вроде как исправил методы CRUD
This commit is contained in:
parent
b6c7cbaa1b
commit
6f45b950dc
@ -53,11 +53,11 @@ namespace WinFormsLabRad1.CollectionGenericObjects
|
||||
/// Перегрузка оператора сложения для класса
|
||||
/// </summary>
|
||||
/// <param name="company">Компания</param>
|
||||
/// <param name="car">Добавляемый объект</param>
|
||||
/// <param name="platforma">Добавляемый объект</param>
|
||||
/// <returns></returns>
|
||||
public static bool operator +(AbstractCompany company, DrawningPlatforma car)
|
||||
public static bool operator +(AbstractCompany company, DrawningPlatforma platforma)
|
||||
{
|
||||
return company._collection?.Insert(car) ?? false;
|
||||
return company._collection?.Insert(platforma) ?? false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Перегрузка оператора удаления для класса
|
||||
|
@ -63,6 +63,7 @@ namespace WinFormsLabRad1.CollectionGenericObjects
|
||||
}
|
||||
protected override void SetObjectsPosition(/*Graphics g*/)
|
||||
{
|
||||
int arayposition = 0;
|
||||
_startPosX = 5;
|
||||
_startPosY = 5;
|
||||
for (int x = 0; x <= _pictureWidth; x = x + _placeSizeWidth)
|
||||
|
@ -66,7 +66,7 @@ namespace WinFormsLabRad1.CollectionGenericObjects
|
||||
{
|
||||
if (_collection[i] == null)
|
||||
{
|
||||
_collection[i] = default(T);
|
||||
_collection[i] = obj;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -81,7 +81,7 @@ namespace WinFormsLabRad1.CollectionGenericObjects
|
||||
// TODO вставка
|
||||
if (_collection[position] == null)
|
||||
{
|
||||
_collection[position] = default(T);
|
||||
_collection[position] = obj;
|
||||
return true;
|
||||
}
|
||||
if (_collection[position] != null)
|
||||
@ -90,7 +90,7 @@ namespace WinFormsLabRad1.CollectionGenericObjects
|
||||
{
|
||||
if (_collection[i] == null)
|
||||
{
|
||||
_collection[i] = default(T);
|
||||
_collection[i] = obj;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@ -100,7 +100,7 @@ namespace WinFormsLabRad1.CollectionGenericObjects
|
||||
{
|
||||
if (_collection[i] == null)
|
||||
{
|
||||
_collection[i] = default(T);
|
||||
_collection[i] = obj;
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
@ -80,8 +80,8 @@ namespace WinFormsLabRad1
|
||||
case nameof(DrawningTankZU):
|
||||
// TODO вызов диалогового окна для выбора цвета
|
||||
drawningPlatforma = new DrawningTankZU(random.Next(100, 300), random.Next(1000, 3000),
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
||||
GetColor(random),
|
||||
GetColor(random),
|
||||
Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)));
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user