использование встроенного делегата
This commit is contained in:
parent
07e42412f4
commit
cd006b5914
@ -19,7 +19,7 @@ namespace AircraftCarrier
|
||||
/// <summary>
|
||||
/// Событие
|
||||
/// </summary>
|
||||
private event WarshipDelegate EventAddWarshp;
|
||||
private event Action<DrawingWarship> EventAddWarshp;
|
||||
/// <summary>
|
||||
/// Конструктор
|
||||
/// </summary>
|
||||
@ -52,11 +52,11 @@ namespace AircraftCarrier
|
||||
/// Добавление события
|
||||
/// </summary>
|
||||
/// <param name="ev"></param>
|
||||
public void AddEvent(WarshipDelegate ev)
|
||||
public void AddEvent(Action<DrawingWarship> ev)
|
||||
{
|
||||
if (EventAddWarshp == null)
|
||||
{
|
||||
EventAddWarshp = new WarshipDelegate(ev);
|
||||
EventAddWarshp = ev;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,8 +0,0 @@
|
||||
namespace AircraftCarrier
|
||||
{
|
||||
/// <summary>
|
||||
/// Делегат для передачи объекта-корабля
|
||||
/// </summary>
|
||||
/// <param name="warship"></param>
|
||||
public delegate void WarshipDelegate(DrawingWarship warship);
|
||||
}
|
Loading…
Reference in New Issue
Block a user