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() ;
}
}