From c85750c8557aa5a80088b9d0a3ab58be85983d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=BE=D0=BC=D0=B0=20=D0=9F=D0=B5=D1=80=D0=BC=D1=8F?= =?UTF-8?q?=D0=BA=D0=BE=D0=B2?= Date: Mon, 8 Apr 2024 11:11:42 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Drawnings/DrawningAccordionBus.cs | 2 -- .../AccordionBus/Drawnings/DrawningBus.cs | 2 -- AccordionBus/AccordionBus/FormBusConfig.cs | 36 +++++++++---------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/AccordionBus/AccordionBus/Drawnings/DrawningAccordionBus.cs b/AccordionBus/AccordionBus/Drawnings/DrawningAccordionBus.cs index 98a41ba..0339b60 100644 --- a/AccordionBus/AccordionBus/Drawnings/DrawningAccordionBus.cs +++ b/AccordionBus/AccordionBus/Drawnings/DrawningAccordionBus.cs @@ -27,8 +27,6 @@ namespace AccordionBus.Drawnings EntityBus = new EntityAccordionBus(speed, weight, bodyColor, additionalColor, onePart, fiveDoors); } - public void SetAdditionalColor(Color color) { (EntityBus as EntityAccordionBus).AdditionalColor = color; } - /// /// Отрисовка транспорта /// diff --git a/AccordionBus/AccordionBus/Drawnings/DrawningBus.cs b/AccordionBus/AccordionBus/Drawnings/DrawningBus.cs index ec619ba..5443447 100644 --- a/AccordionBus/AccordionBus/Drawnings/DrawningBus.cs +++ b/AccordionBus/AccordionBus/Drawnings/DrawningBus.cs @@ -69,8 +69,6 @@ namespace AccordionBus.Drawnings _startPosY = null; } - public void SetBodyColor(Color color) { EntityBus.SetBodyColor(color); } - /// /// Конструктор границ объекта /// diff --git a/AccordionBus/AccordionBus/FormBusConfig.cs b/AccordionBus/AccordionBus/FormBusConfig.cs index b321ef3..35421b9 100644 --- a/AccordionBus/AccordionBus/FormBusConfig.cs +++ b/AccordionBus/AccordionBus/FormBusConfig.cs @@ -108,28 +108,28 @@ namespace AccordionBus switch (e.Data?.GetData(DataFormats.Text)?.ToString()) { case "panelRed": - _bus.SetBodyColor(Color.Red); + _bus.EntityBus.SetBodyColor(Color.Red); break; case "panelBlue": - _bus.SetBodyColor(Color.Blue); + _bus.EntityBus.SetBodyColor(Color.Blue); break; case "panelGreen": - _bus.SetBodyColor(Color.Green); + _bus.EntityBus.SetBodyColor(Color.Green); break; case "panelYellow": - _bus.SetBodyColor(Color.Yellow); + _bus.EntityBus.SetBodyColor(Color.Yellow); break; case "panelWhite": - _bus.SetBodyColor(Color.White); + _bus.EntityBus.SetBodyColor(Color.White); break; case "panelGray": - _bus.SetBodyColor(Color.Gray); + _bus.EntityBus.SetBodyColor(Color.Gray); break; case "panelBlack": - _bus.SetBodyColor(Color.Black); + _bus.EntityBus.SetBodyColor(Color.Black); break; case "panelPurple": - _bus.SetBodyColor(Color.Purple); + _bus.EntityBus.SetBodyColor(Color.Purple); break; } @@ -138,37 +138,37 @@ namespace AccordionBus private void labelAdditionalColor_DragDrop(object sender, DragEventArgs e) { - if (_bus is DrawningAccordionBus) + if (_bus.EntityBus is EntityAccordionBus entityAccordionBus) { switch (e.Data?.GetData(DataFormats.Text)?.ToString()) { case "panelRed": - (_bus as DrawningAccordionBus).SetAdditionalColor(Color.Red); + entityAccordionBus.SetAdditionalColor(Color.Red); break; case "panelBlue": - (_bus as DrawningAccordionBus).SetAdditionalColor(Color.Blue); + entityAccordionBus.SetAdditionalColor(Color.Blue); break; case "panelGreen": - (_bus as DrawningAccordionBus).SetAdditionalColor(Color.Green); + entityAccordionBus.SetAdditionalColor(Color.Green); break; case "panelYellow": - (_bus as DrawningAccordionBus).SetAdditionalColor(Color.Yellow); + entityAccordionBus.SetAdditionalColor(Color.Yellow); break; case "panelWhite": - (_bus as DrawningAccordionBus).SetAdditionalColor(Color.White); + entityAccordionBus.SetAdditionalColor(Color.White); break; case "panelGray": - (_bus as DrawningAccordionBus).SetAdditionalColor(Color.Gray); + entityAccordionBus.SetAdditionalColor(Color.Gray); break; case "panelBlack": - (_bus as DrawningAccordionBus).SetAdditionalColor(Color.Black); + entityAccordionBus.SetAdditionalColor(Color.Black); break; case "panelPurple": - (_bus as DrawningAccordionBus).SetAdditionalColor(Color.Purple); + entityAccordionBus.SetAdditionalColor(Color.Purple); break; } - DrawObject(); + DrawObject() ; } }