From df129f6eabfe2f4edc012f8ac8b4e275bed401af Mon Sep 17 00:00:00 2001 From: prodigygirl Date: Mon, 24 Oct 2022 19:35:30 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D1=82=D0=BE=D0=B4=D1=8B=20DragDrop?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B8=20=D1=86=D0=B2=D0=B5=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ArmoredCar/ArmoredCar/FormArmoredCarConfig.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ArmoredCar/ArmoredCar/FormArmoredCarConfig.cs b/ArmoredCar/ArmoredCar/FormArmoredCarConfig.cs index 11684a1..fe55d99 100644 --- a/ArmoredCar/ArmoredCar/FormArmoredCarConfig.cs +++ b/ArmoredCar/ArmoredCar/FormArmoredCarConfig.cs @@ -151,7 +151,10 @@ namespace ArmoredCar /// 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(); + } } /// @@ -161,7 +164,12 @@ namespace ArmoredCar /// 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(); + } /// /// Добавление бронемашины