diff --git a/AirBomber/AirBomber/AirPlaneDelegate.cs b/AirBomber/AirBomber/AirPlaneDelegate.cs
deleted file mode 100644
index e912336..0000000
--- a/AirBomber/AirBomber/AirPlaneDelegate.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace AirBomber
-{
- public delegate void AirPlaneDelegate(DrawningAirPlane plane);
-}
diff --git a/AirBomber/AirBomber/FormPlaneCollection.cs b/AirBomber/AirBomber/FormPlaneCollection.cs
index 2d5b92a..6ed5627 100644
--- a/AirBomber/AirBomber/FormPlaneCollection.cs
+++ b/AirBomber/AirBomber/FormPlaneCollection.cs
@@ -63,6 +63,28 @@ namespace AirBomber
formPlaneConfig.AddEvent(AddPlane);
formPlaneConfig.Show();
}
+ private void AddPlane(DrawningAirPlane plane)
+ {
+ plane._pictureWidth = pictureBoxCollection.Width;
+ plane._pictureHeight = pictureBoxCollection.Height;
+
+ if (listBoxStorages.SelectedIndex == -1) return;
+
+ var obj = _storage[listBoxStorages.SelectedItem.ToString() ?? string.Empty];
+ if (obj == null)
+ {
+ return;
+ }
+ if (obj + plane > -1)
+ {
+ MessageBox.Show("Объект добавлен");
+ pictureBoxCollection.Image = obj.ShowPlanes();
+ }
+ else
+ {
+ MessageBox.Show("Не удалось добавить объект");
+ }
+ }
///
/// Удаление объекта из набора
///
@@ -140,27 +162,6 @@ namespace AirBomber
ReloadObjects();
}
}
- private void AddPlane(DrawningAirPlane plane)
- {
- plane._pictureWidth = pictureBoxCollection.Width;
- plane._pictureHeight = pictureBoxCollection.Height;
-
- if (listBoxStorages.SelectedIndex == -1) return;
-
- var obj = _storage[listBoxStorages.SelectedItem.ToString() ?? string.Empty];
- if (obj == null)
- {
- return;
- }
- if (obj + plane > -1)
- {
- MessageBox.Show("Объект добавлен");
- pictureBoxCollection.Image = obj.ShowPlanes();
- }
- else
- {
- MessageBox.Show("Не удалось добавить объект");
- }
- }
+
}
}
diff --git a/AirBomber/AirBomber/FormPlaneConfig.Designer.cs b/AirBomber/AirBomber/FormPlaneConfig.Designer.cs
index 70e2b0c..dbf6319 100644
--- a/AirBomber/AirBomber/FormPlaneConfig.Designer.cs
+++ b/AirBomber/AirBomber/FormPlaneConfig.Designer.cs
@@ -126,8 +126,6 @@
panelPurple.Name = "panelPurple";
panelPurple.Size = new Size(54, 54);
panelPurple.TabIndex = 1;
- panelPurple.DragDrop += PanelObject_DragDrop;
- panelPurple.DragEnter += PanelObject_DragEnter;
panelPurple.MouseDown += panelColor_MouseDown;
//
// panelBlack
@@ -137,8 +135,6 @@
panelBlack.Name = "panelBlack";
panelBlack.Size = new Size(54, 54);
panelBlack.TabIndex = 1;
- panelBlack.DragDrop += PanelObject_DragDrop;
- panelBlack.DragEnter += PanelObject_DragEnter;
panelBlack.MouseDown += panelColor_MouseDown;
//
// panelGray
@@ -148,8 +144,6 @@
panelGray.Name = "panelGray";
panelGray.Size = new Size(54, 54);
panelGray.TabIndex = 1;
- panelGray.DragDrop += PanelObject_DragDrop;
- panelGray.DragEnter += PanelObject_DragEnter;
panelGray.MouseDown += panelColor_MouseDown;
//
// panelWhite
@@ -159,8 +153,6 @@
panelWhite.Name = "panelWhite";
panelWhite.Size = new Size(54, 54);
panelWhite.TabIndex = 1;
- panelWhite.DragDrop += PanelObject_DragDrop;
- panelWhite.DragEnter += PanelObject_DragEnter;
panelWhite.MouseDown += panelColor_MouseDown;
//
// panelYellow
@@ -170,8 +162,6 @@
panelYellow.Name = "panelYellow";
panelYellow.Size = new Size(54, 54);
panelYellow.TabIndex = 1;
- panelYellow.DragDrop += PanelObject_DragDrop;
- panelYellow.DragEnter += PanelObject_DragEnter;
panelYellow.MouseDown += panelColor_MouseDown;
//
// panelBlue
@@ -181,8 +171,6 @@
panelBlue.Name = "panelBlue";
panelBlue.Size = new Size(54, 54);
panelBlue.TabIndex = 1;
- panelBlue.DragDrop += PanelObject_DragDrop;
- panelBlue.DragEnter += PanelObject_DragEnter;
panelBlue.MouseDown += panelColor_MouseDown;
//
// panelGreen
@@ -192,8 +180,6 @@
panelGreen.Name = "panelGreen";
panelGreen.Size = new Size(54, 54);
panelGreen.TabIndex = 1;
- panelGreen.DragDrop += PanelObject_DragDrop;
- panelGreen.DragEnter += PanelObject_DragEnter;
panelGreen.MouseDown += panelColor_MouseDown;
//
// panelRed
@@ -203,8 +189,6 @@
panelRed.Name = "panelRed";
panelRed.Size = new Size(54, 54);
panelRed.TabIndex = 0;
- panelRed.DragDrop += PanelObject_DragDrop;
- panelRed.DragEnter += PanelObject_DragEnter;
panelRed.MouseDown += panelColor_MouseDown;
//
// checkBoxFuelTanks
diff --git a/AirBomber/AirBomber/FormPlaneConfig.cs b/AirBomber/AirBomber/FormPlaneConfig.cs
index b00e861..b41872a 100644
--- a/AirBomber/AirBomber/FormPlaneConfig.cs
+++ b/AirBomber/AirBomber/FormPlaneConfig.cs
@@ -19,8 +19,8 @@ namespace AirBomber
///
/// Делегат для передачи объекта-автомобиля
///
- ///
- private event AirPlaneDelegate? EventAddPlane;
+ ///
+ private event Action? EventAddPlane;
///
/// Конструктор
///
@@ -53,7 +53,7 @@ namespace AirBomber
/// Добавление события
///
/// Привязанный метод
- public void AddEvent(AirPlaneDelegate ev)
+ public void AddEvent(Action ev)
{
if (EventAddPlane == null)
{