diff --git a/Project_airbus/Project_airbus/FormAirplanConfig.cs b/Project_airbus/Project_airbus/FormAirplanConfig.cs index 75843d9..9e80d4e 100644 --- a/Project_airbus/Project_airbus/FormAirplanConfig.cs +++ b/Project_airbus/Project_airbus/FormAirplanConfig.cs @@ -3,17 +3,20 @@ using Project_airbus.Entities; namespace Project_airbus; +/// +/// Форма конфигурации объекта +/// public partial class FormAirplanConfig : Form { /// /// Объект - прорисовка самолёта /// - private DrawingAirplan? _airplan = null; + private DrawingAirplan? _airplan; /// /// Событие для передачи объекта /// - private event AirplanDelegate? AirplanDelegate; + private event Action _airplanDelegate; /// /// Конструктор @@ -37,9 +40,9 @@ public partial class FormAirplanConfig : Form /// Привязка внешнего метода к событию /// /// - public void AddEvent(AirplanDelegate airplanDelegate) + public void AddEvent(Action airplanDelegate) { - AirplanDelegate += airplanDelegate; + _airplanDelegate += airplanDelegate; } /// @@ -106,6 +109,11 @@ public partial class FormAirplanConfig : Form (sender as Control)?.DoDragDrop((sender as Control)?.BackColor, DragDropEffects.Move | DragDropEffects.Copy); } + /// + /// Передача основного цвета + /// + /// + /// private void labelBodyColor_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(typeof(Color))) @@ -117,6 +125,12 @@ public partial class FormAirplanConfig : Form e.Effect = DragDropEffects.None; } } + + /// + /// Прорисовка с основным цветом + /// + /// + /// private void labelBodyColor_DragDrop(object sender, DragEventArgs e) { if (_airplan != null) @@ -125,6 +139,12 @@ public partial class FormAirplanConfig : Form DrawObject(); } } + + /// + /// Передача дополнительного цвета + /// + /// + /// private void labelAdditionalColor_DragEnter(object sender, DragEventArgs e) { if (_airplan is DrawingAirbus) @@ -140,6 +160,11 @@ public partial class FormAirplanConfig : Form } } + /// + /// Прорисовка с дополнительным цветом + /// + /// + /// private void labelAdditionalColor_DragDrop(object sender, DragEventArgs e) { if (_airplan?.EntityAirplan is EntityAirbus _airbus) @@ -158,7 +183,7 @@ public partial class FormAirplanConfig : Form { if (_airplan != null) { - AirplanDelegate?.Invoke(_airplan); + _airplanDelegate?.Invoke(_airplan); Close(); } }