Изменение делегата

This commit is contained in:
10Г Егор Романов 2022-11-20 21:45:26 +04:00
parent d4c66681d1
commit c69dd461c0

View File

@ -17,7 +17,7 @@ namespace HoistingCrane
public DrawingHoistingCrane SelectedHoistingCrane { get; private set; } public DrawingHoistingCrane SelectedHoistingCrane { get; private set; }
//событие //событие
private event Action<DrawingHoistingCrane> EventAddHoistingCrane; private event HoistingCraneDelegate EventAddHoistingCrane;
//конструктор //конструктор
public FormHoistingCraneConfig() public FormHoistingCraneConfig()
@ -45,11 +45,11 @@ namespace HoistingCrane
} }
//добавление события //добавление события
public void AddEvent(Action<DrawingHoistingCrane> ev) public void AddEvent(HoistingCraneDelegate ev)
{ {
if (EventAddHoistingCrane == null) if (EventAddHoistingCrane == null)
{ {
EventAddHoistingCrane = new Action<DrawingHoistingCrane>(ev); EventAddHoistingCrane = new HoistingCraneDelegate(ev);
} }
else else
{ {