diff --git a/Excavator/Excavator/ExcavatorDelegate.cs b/Excavator/Excavator/ExcavatorDelegate.cs
deleted file mode 100644
index fb92925..0000000
--- a/Excavator/Excavator/ExcavatorDelegate.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using Excavator.Drawnings;
-
-namespace Excavator;
-
-///
-/// Делегат передачи объекта класса-прорисовки
-///
-///
-public delegate void ExcavatorDelegate(DrawningSimpleExcavator excavator);
-
diff --git a/Excavator/Excavator/FormExcavatorCollection.cs b/Excavator/Excavator/FormExcavatorCollection.cs
index 47dfdc5..eee3926 100644
--- a/Excavator/Excavator/FormExcavatorCollection.cs
+++ b/Excavator/Excavator/FormExcavatorCollection.cs
@@ -35,7 +35,7 @@ public partial class FormExcavatorCollection : Form
return;
}
FormExcavatorConfig form = new();
- form.ExcavatorDelegate += SetExcavator;
+ form._excavatorDelegate += SetExcavator;
form.Show();
}
diff --git a/Excavator/Excavator/FormExcavatorConfig.cs b/Excavator/Excavator/FormExcavatorConfig.cs
index 967f9c9..12f45ea 100644
--- a/Excavator/Excavator/FormExcavatorConfig.cs
+++ b/Excavator/Excavator/FormExcavatorConfig.cs
@@ -1,6 +1,5 @@
using Excavator.Drawnings;
using Excavator.Entities;
-using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrackBar;
namespace Excavator;
///
@@ -13,7 +12,7 @@ public partial class FormExcavatorConfig : Form
///
/// Событие для передачи объекта
///
- public event ExcavatorDelegate? ExcavatorDelegate;
+ public event Action? _excavatorDelegate;
public FormExcavatorConfig()
{
@@ -35,9 +34,9 @@ public partial class FormExcavatorConfig : Form
/// Привязка внешнего метода к событию
///
///
- public void AddEvent(ExcavatorDelegate excavatorDelegate)
+ public void AddEvent(Action? excavatorDelegate)
{
- ExcavatorDelegate += excavatorDelegate;
+ _excavatorDelegate += excavatorDelegate;
}
///
@@ -108,7 +107,7 @@ public partial class FormExcavatorConfig : Form
{
if (_excavator != null)
{
- ExcavatorDelegate?.Invoke(_excavator);
+ _excavatorDelegate?.Invoke(_excavator);
Close();
}
}