Lab5 defenetly Done

This commit is contained in:
Artyom_Yashin 2023-11-10 10:20:20 +04:00
parent 4e86ac6cb0
commit 41244fc58c
3 changed files with 3 additions and 22 deletions

View File

@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjectAirBomber.DrawingObjects;
namespace ProjectAirBomber
{
/// <summary>
/// Делегат для передачи объекта
/// </summary>
public delegate void PlaneDelegate(DrawingPlane plane);
}

View File

@ -114,7 +114,7 @@ namespace ProjectAirBomber
}
FormPlaneConfig form = new FormPlaneConfig(pictureBoxCollection.Width, pictureBoxCollection.Height);
form.Show();
PlaneDelegate? planeDelegate = new((plane) => {
Action<DrawingPlane>? planeDelegate = new((plane) => {
if (obj + plane)
{
MessageBox.Show("Объект добавлен");

View File

@ -21,10 +21,7 @@ namespace ProjectAirBomber
/// Переменная
/// </summary>
DrawingPlane? _plane = null;
/// <summary>
/// Событие
/// </summary>
private event PlaneDelegate? EventAddPlane;
Action<DrawingPlane>? EventAddPlane;
/// <summary>
/// Конструктор
/// </summary>
@ -60,7 +57,7 @@ namespace ProjectAirBomber
/// Добавление события
/// </summary>
/// <param name="ev">Привязанный метод</param>
public void AddEvent(PlaneDelegate ev)
public void AddEvent(Action<DrawingPlane>? ev)
{
if (EventAddPlane == null)
{