LabWork05
This commit is contained in:
parent
e3166e83ef
commit
b2124bf15a
@ -16,7 +16,7 @@ namespace ProjectMotorboat
|
|||||||
{
|
{
|
||||||
private DrawningBoat? _boat;
|
private DrawningBoat? _boat;
|
||||||
|
|
||||||
private event BoatDelegate? BoatDelegate;
|
private event Action<DrawningBoat>? BoatDelegate;
|
||||||
public FormBoatConfig()
|
public FormBoatConfig()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@ -32,9 +32,16 @@ namespace ProjectMotorboat
|
|||||||
buttonCancel.Click += (sender, e) => Close();
|
buttonCancel.Click += (sender, e) => Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddEvent(BoatDelegate boatDelegate)
|
public void AddEvent(Action<DrawningBoat> boatDelegate)
|
||||||
{
|
{
|
||||||
BoatDelegate += boatDelegate;
|
if (BoatDelegate != null)
|
||||||
|
{
|
||||||
|
BoatDelegate = boatDelegate;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BoatDelegate += boatDelegate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawObject()
|
private void DrawObject()
|
||||||
|
Loading…
Reference in New Issue
Block a user