Делегат заменен на встроенный

This commit is contained in:
VictoriaPresnyakova 2022-11-19 19:06:56 +04:00
parent 1a9daeafe4
commit ca7d484111
2 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ namespace Catamaran
/// <summary> /// <summary>
/// Событие /// Событие
/// </summary> /// </summary>
private event BoatDelegate EventAddBoat; private event Action<DrawingBoat> EventAddBoat;
/// <summary> /// <summary>
/// Конструктор /// Конструктор
/// </summary> /// </summary>
@ -55,11 +55,11 @@ namespace Catamaran
/// Добавление события /// Добавление события
/// </summary> /// </summary>
/// <param name="ev"></param> /// <param name="ev"></param>
public void AddEvent(BoatDelegate ev) public void AddEvent(Action<DrawingBoat> ev)
{ {
if (EventAddBoat == null) if (EventAddBoat == null)
{ {
EventAddBoat = new BoatDelegate(ev); EventAddBoat = new Action<DrawingBoat>(ev);
} }
else else
{ {

View File

@ -213,7 +213,7 @@ namespace Catamaran
private void buttonAddBoat_Click_1(object sender, EventArgs e) private void buttonAddBoat_Click_1(object sender, EventArgs e)
{ {
var formBoatConfig = new FormBoatConfig(); var formBoatConfig = new FormBoatConfig();
formBoatConfig.AddEvent(new BoatDelegate(AddBoat)); formBoatConfig.AddEvent(new Action<DrawingBoat>(AddBoat));
// TODO Call method AddEvent from formCarConfig // TODO Call method AddEvent from formCarConfig
formBoatConfig.Show(); formBoatConfig.Show();
} }