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