From dad5aefdd02c39be73d7e6cfe71d049f26b388b4 Mon Sep 17 00:00:00 2001 From: ValAnn Date: Fri, 17 Nov 2023 17:08:35 +0400 Subject: [PATCH] done --- DumpTruck/DumpTruck/FormCarCollection.cs | 19 +++++++------------ DumpTruck/DumpTruck/FormCarConfig.cs | 4 ++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/DumpTruck/DumpTruck/FormCarCollection.cs b/DumpTruck/DumpTruck/FormCarCollection.cs index 30ec6cc..345f7b2 100644 --- a/DumpTruck/DumpTruck/FormCarCollection.cs +++ b/DumpTruck/DumpTruck/FormCarCollection.cs @@ -19,7 +19,7 @@ namespace DumpTruck { public partial class FormCarCollection : Form { - //private readonly CarsGenericCollection _cars; + private readonly CarsGenericStorage _storage; public FormCarCollection() { @@ -28,16 +28,6 @@ namespace DumpTruck pictureBoxCollection.Height); } - private void Form2_Load(object sender, EventArgs e) - { - - } - - private void pictureBoxCollection_Click(object sender, EventArgs e) - { - - } - private void ReloadObjects() { int index = listBoxStorages.SelectedIndex; @@ -78,7 +68,7 @@ pictureBoxCollection.Height); FormCarConfig form = new FormCarConfig(); form.Show(); - CarDelegate? carDelegate = new((m) => + Action? carDelegate = new((m) => { int q = obj + m; @@ -92,6 +82,11 @@ pictureBoxCollection.Height); MessageBox.Show("Не удалось добавить объект"); } }); + + Action? ColorDelegate = new((m) => + { + MessageBox.Show(m.ToString()); + }); form.AddEvent(carDelegate); } diff --git a/DumpTruck/DumpTruck/FormCarConfig.cs b/DumpTruck/DumpTruck/FormCarConfig.cs index 074690b..7e1ca2a 100644 --- a/DumpTruck/DumpTruck/FormCarConfig.cs +++ b/DumpTruck/DumpTruck/FormCarConfig.cs @@ -15,7 +15,7 @@ namespace DumpTruck { DrawningCar? _car = null; - private event CarDelegate? EventAddCar; + public event Action? EventAddCar; public FormCarConfig() { @@ -123,7 +123,7 @@ DragDropEffects.Move | DragDropEffects.Copy); DrawCar(); } - public void AddEvent(CarDelegate ev) + public void AddEvent(Action ev) { if (EventAddCar == null) {