ISEbd-12 Khaliullov LabWork05 Simple #5
@ -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);
|
@ -21,12 +21,7 @@ public partial class FormAircraftConfig : Form
|
||||
/// Объект - прорисовка самолета
|
||||
/// </summary>
|
||||
private DrawningAircraft? _aircraft;
|
||||
|
||||
/// <summary>
|
||||
/// Событие для передачи объекта
|
||||
/// </summary>
|
||||
|
||||
private event AircraftDelegate? AircraftDelegate;
|
||||
private event Action<DrawningAircraft>? AircraftDelegate;
|
||||
|
||||
/// <summary>
|
||||
/// Конструктор
|
||||
@ -48,10 +43,10 @@ public partial class FormAircraftConfig : Form
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Привязка внешнего метода к событию
|
||||
/// Событие для передачи объекта
|
||||
/// </summary>
|
||||
/// <param name="aircraftDelegate"></param>
|
||||
public void AddEvent(AircraftDelegate aircraftDelegate)
|
||||
public void AddEvent(Action<DrawningAircraft> aircraftDelegate)
|
||||
{
|
||||
if (AircraftDelegate != null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user