Пятая лабораторная

This commit is contained in:
Катя Ихонкина 2022-11-18 22:19:04 +04:00
parent 2a6c6e17e6
commit aa6f30d71d
2 changed files with 3 additions and 13 deletions

View File

@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MotorBoat
{
public delegate void BoatDelegate(DrawningBoat boat);
}

View File

@ -12,7 +12,7 @@ namespace MotorBoat
{
public partial class FormBoatConfig : Form
{
private event BoatDelegate EventAddBoat;
private event Action<DrawningBoat> EventAddBoat;
DrawningBoat _boat = null;
public FormBoatConfig()
{
@ -28,11 +28,11 @@ namespace MotorBoat
buttonCancel.Click += (s, a) => Close();
}
public void AddEvent(BoatDelegate ev)
public void AddEvent(Action<DrawningBoat> ev)
{
if (EventAddBoat == null)
{
EventAddBoat = new BoatDelegate(ev);
EventAddBoat = new Action<DrawningBoat>(ev);
}
else
{