diff --git a/GasolineTanker/GasolineTanker/FormGasolineTankerConfig.cs b/GasolineTanker/GasolineTanker/FormGasolineTankerConfig.cs index 73c6a11..b28d121 100644 --- a/GasolineTanker/GasolineTanker/FormGasolineTankerConfig.cs +++ b/GasolineTanker/GasolineTanker/FormGasolineTankerConfig.cs @@ -13,7 +13,7 @@ namespace GasolineTanker public partial class FormGasolineTankerConfig : Form { DrawingGasolineTanker _gasolineTanker = null; - private event GasolineTankerDelegate EventAddGasolineTanker; + private event Action EventAddGasolineTanker; public FormGasolineTankerConfig() { InitializeComponent(); @@ -29,11 +29,11 @@ namespace GasolineTanker buttonCancel.Click += (s, e) => Close(); } - public void AddEvent(GasolineTankerDelegate ev) + public void AddEvent(Action ev) { if (EventAddGasolineTanker == null) { - EventAddGasolineTanker = new GasolineTankerDelegate(ev); + EventAddGasolineTanker = ev; } else { diff --git a/GasolineTanker/GasolineTanker/FormMapWithSetGasolineTanker.cs b/GasolineTanker/GasolineTanker/FormMapWithSetGasolineTanker.cs index 4dc139a..c44e29c 100644 --- a/GasolineTanker/GasolineTanker/FormMapWithSetGasolineTanker.cs +++ b/GasolineTanker/GasolineTanker/FormMapWithSetGasolineTanker.cs @@ -87,8 +87,6 @@ namespace GasolineTanker } } - - private void ButtonShowStorage_Click(object sender, EventArgs e) { if (listBoxMaps.SelectedIndex == -1) @@ -112,7 +110,6 @@ namespace GasolineTanker { return; } - //получаем имя кнопки string name = ((Button)sender)?.Name ?? string.Empty; Direction dir = Direction.None; switch (name) @@ -132,7 +129,6 @@ namespace GasolineTanker } pictureBox.Image = _mapGasolineTankerCollectionGeneric.MoveObject(dir); } - private void ComboBoxSelectorMap_SelectedIndexChanged(object sender, EventArgs e) { AbstractMap map = null; @@ -155,7 +151,6 @@ namespace GasolineTanker _mapGasolineTankerCollectionGeneric = null; } } - private void buttonAddMap_Click(object sender, EventArgs e) { if (comboBoxSelectorMap.SelectedIndex == -1 || string.IsNullOrEmpty(textBoxNewMapName.Text)) @@ -171,7 +166,6 @@ namespace GasolineTanker _mapsCollection.AddMap(textBoxNewMapName.Text, _mapsDict[comboBoxSelectorMap.Text]); ReloadMaps(); } - private void buttonDeleteMap_Click(object sender, EventArgs e) { if (listBoxMaps.SelectedIndex == -1) diff --git a/GasolineTanker/GasolineTanker/GasolineTankerDelegate.cs b/GasolineTanker/GasolineTanker/GasolineTankerDelegate.cs deleted file mode 100644 index 2d7adf8..0000000 --- a/GasolineTanker/GasolineTanker/GasolineTankerDelegate.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace GasolineTanker -{ - public delegate void GasolineTankerDelegate(DrawingGasolineTanker gasolineTanker); -}