Встроенный*

This commit is contained in:
rakhaliullov 2024-04-16 23:03:40 +03:00
parent f1592df7b7
commit d81342522f
2 changed files with 3 additions and 22 deletions

View File

@ -1,14 +0,0 @@
using Stormtrooper.Drawnings;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Stormtrooper;
/// <summary>
/// Делегат передачи объекта-прорисовки
/// </summary>
/// <param name="aircraft"></param>
public delegate void AircraftDelegate(DrawningAircraft aircraft);

View File

@ -21,12 +21,7 @@ public partial class FormAircraftConfig : Form
/// Объект - прорисовка самолета /// Объект - прорисовка самолета
/// </summary> /// </summary>
private DrawningAircraft? _aircraft; private DrawningAircraft? _aircraft;
private event Action<DrawningAircraft>? AircraftDelegate;
/// <summary>
/// Событие для передачи объекта
/// </summary>
private event AircraftDelegate? AircraftDelegate;
/// <summary> /// <summary>
/// Конструктор /// Конструктор
@ -48,10 +43,10 @@ public partial class FormAircraftConfig : Form
} }
/// <summary> /// <summary>
/// Привязка внешнего метода к событию /// Событие для передачи объекта
/// </summary> /// </summary>
/// <param name="aircraftDelegate"></param> /// <param name="aircraftDelegate"></param>
public void AddEvent(AircraftDelegate aircraftDelegate) public void AddEvent(Action<DrawningAircraft> aircraftDelegate)
{ {
if (AircraftDelegate != null) if (AircraftDelegate != null)
{ {