Методы DragDrop для установки цветов

This commit is contained in:
prodigygirl 2022-10-24 19:35:30 +04:00
parent 5859a15b9d
commit df129f6eab

View File

@ -151,7 +151,10 @@ namespace ArmoredCar
/// <param name="e"></param>
private void LabelBaseColor_DragDrop(object sender, DragEventArgs e)
{
// TODO Call method from object _car and set color
if (_armoredCar != null) {
_armoredCar.setColor((Color)e.Data.GetData(typeof(Color)));
DrawArmoredCar();
}
}
/// <summary>
@ -161,7 +164,12 @@ namespace ArmoredCar
/// <param name="e"></param>
private void LabelDopColor_DragDrop(object sender, DragEventArgs e)
{
// TODO Call method from object _car if _car is DrawningSportCar and set dop color
if (_armoredCar is not DrawningTank tank)
return;
tank.setDopColor((Color)e.Data.GetData(typeof(Color)));
DrawArmoredCar();
}
/// <summary>
/// Добавление бронемашины