PIbd-11 Permyakov R.G. AccordionBus Simple Lab5 #5
@ -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; }
|
||||
|
||||
/// <summary>
|
||||
/// Отрисовка транспорта
|
||||
/// </summary>
|
||||
|
@ -69,8 +69,6 @@ namespace AccordionBus.Drawnings
|
||||
_startPosY = null;
|
||||
}
|
||||
|
||||
public void SetBodyColor(Color color) { EntityBus.SetBodyColor(color); }
|
||||
|
||||
/// <summary>
|
||||
/// Конструктор границ объекта
|
||||
/// </summary>
|
||||
|
@ -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() ;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user