From 67dde9fb10c379819850cac8262f8bf23d4b50b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=8F=D1=80=20=D0=90=D0=B3=D0=BB?= =?UTF-8?q?=D0=B8=D1=83=D0=BB=D0=BB=D0=BE=D0=B2?= Date: Wed, 19 Oct 2022 17:21:13 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BF=D0=BE=20DragAndDr?= =?UTF-8?q?op?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirBomber/AirBomber/FormAirplaneConfig.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/AirBomber/AirBomber/FormAirplaneConfig.cs b/AirBomber/AirBomber/FormAirplaneConfig.cs index 9359022..0ccd064 100644 --- a/AirBomber/AirBomber/FormAirplaneConfig.cs +++ b/AirBomber/AirBomber/FormAirplaneConfig.cs @@ -7,7 +7,6 @@ namespace AirBomber /// public partial class FormAirplaneConfig : Form { - private Type _currTypeEngines = typeof(DrawningAirplaneEngines); /// /// Переменная-выбранная самолет /// @@ -205,13 +204,13 @@ namespace AirBomber default: return; } - _currTypeEngines = typesOfEngines.GetType(); - (sender as Label).DoDragDrop(typesOfEngines, DragDropEffects.Move | DragDropEffects.Copy); + (sender as Label).DoDragDrop(Tuple.Create(typesOfEngines.GetType(), typesOfEngines), DragDropEffects.Move | DragDropEffects.Copy); } private void labelTypesOfEngines_DragDrop(object sender, DragEventArgs e) { - var engines = (IAirplaneEngines)e.Data.GetData(_currTypeEngines); + var data = (Tuple)e.Data.GetData(typeof(Tuple)); + var engines = data.Item2; engines.CountEngines = _airplane.DrawningEngines.CountEngines; if (_airplane is DrawningAirBomber) { @@ -225,6 +224,6 @@ namespace AirBomber DrawAirplane(); } - private void labelTypesOfEngines_DragEnter(object sender, DragEventArgs e) => setDragEffect(e, _currTypeEngines, _airplane != null); + private void labelTypesOfEngines_DragEnter(object sender, DragEventArgs e) => setDragEffect(e, typeof(Tuple), _airplane != null); } } \ No newline at end of file