From 4116ffde8793facc9e6d8795b02345b013470f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D1=88=D0=B8=D0=BD=20=D0=9C=D0=B0=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BC?= Date: Sun, 13 Nov 2022 21:33:30 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=82=D0=BE=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GasolineTanker/FormGasolineTankerConfig.cs | 6 +++--- .../GasolineTanker/FormMapWithSetGasolineTanker.cs | 6 ------ .../GasolineTanker/GasolineTankerDelegate.cs | 10 ---------- 3 files changed, 3 insertions(+), 19 deletions(-) delete mode 100644 GasolineTanker/GasolineTanker/GasolineTankerDelegate.cs 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); -}