исправления

This commit is contained in:
10Г Егор Романов 2022-12-04 21:18:39 +04:00
parent 782f65bd28
commit 48371b6261
2 changed files with 3 additions and 12 deletions

View File

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

View File

@ -1,9 +0,0 @@

namespace HoistingCrane
{
/// <summary>
/// Делегат для передачи объекта
/// </summary>
/// <param name="hoistingCrane"></param>
public delegate void HoistingCraneDelegate(DrawingHoistingCrane hoistingCrane);
}