Принятый код, не ответил на вопрос
This commit is contained in:
parent
8bd90876de
commit
69a860866f
@ -64,11 +64,6 @@ namespace Bus
|
||||
_drawingObject.MoveObject(MoveObjectBack(direction));
|
||||
}
|
||||
return DrawMapWithObject();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -126,7 +121,6 @@ namespace Bus
|
||||
}
|
||||
_drawingObject.DrawingObject(gr);
|
||||
return bmp;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,5 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Bus
|
||||
{
|
||||
public delegate void BusDelegate(DrawingBus bus);
|
||||
|
||||
public delegate void BusDelegate(DrawingBus bus);
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ namespace Bus
|
||||
{
|
||||
DopColor = dopColor;
|
||||
DopColor1 = bodyColor;
|
||||
BodyKit = bodyKit = true;
|
||||
Wing = wing = true;
|
||||
Sportline = sportline = true;
|
||||
BodyKit = bodyKit;
|
||||
Wing = wing;
|
||||
Sportline = sportline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
12
Bus/Bus/FormBusConfig.Designer.cs
generated
12
Bus/Bus/FormBusConfig.Designer.cs
generated
@ -196,9 +196,9 @@
|
||||
this.checkBoxBodyKit.AutoSize = true;
|
||||
this.checkBoxBodyKit.Location = new System.Drawing.Point(5, 158);
|
||||
this.checkBoxBodyKit.Name = "checkBoxBodyKit";
|
||||
this.checkBoxBodyKit.Size = new System.Drawing.Size(83, 24);
|
||||
this.checkBoxBodyKit.Size = new System.Drawing.Size(97, 24);
|
||||
this.checkBoxBodyKit.TabIndex = 6;
|
||||
this.checkBoxBodyKit.Text = "BodyKit";
|
||||
this.checkBoxBodyKit.Text = "Лестница";
|
||||
this.checkBoxBodyKit.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBoxWing
|
||||
@ -208,7 +208,7 @@
|
||||
this.checkBoxWing.Name = "checkBoxWing";
|
||||
this.checkBoxWing.Size = new System.Drawing.Size(66, 24);
|
||||
this.checkBoxWing.TabIndex = 5;
|
||||
this.checkBoxWing.Text = "Wing";
|
||||
this.checkBoxWing.Text = "Окна";
|
||||
this.checkBoxWing.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBoxSportline
|
||||
@ -216,9 +216,9 @@
|
||||
this.checkBoxSportline.AutoSize = true;
|
||||
this.checkBoxSportline.Location = new System.Drawing.Point(5, 98);
|
||||
this.checkBoxSportline.Name = "checkBoxSportline";
|
||||
this.checkBoxSportline.Size = new System.Drawing.Size(94, 24);
|
||||
this.checkBoxSportline.Size = new System.Drawing.Size(118, 24);
|
||||
this.checkBoxSportline.TabIndex = 4;
|
||||
this.checkBoxSportline.Text = "SportLine";
|
||||
this.checkBoxSportline.Text = "Второй этаж";
|
||||
this.checkBoxSportline.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// labelWeight
|
||||
@ -285,7 +285,7 @@
|
||||
this.labelDopColor.Text = "Доп. цвет";
|
||||
this.labelDopColor.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.labelDopColor.DragDrop += new System.Windows.Forms.DragEventHandler(this.LabelDopColor_DragDrop);
|
||||
this.labelDopColor.DragEnter += new System.Windows.Forms.DragEventHandler(this.LabelDopColor_DragEnter);
|
||||
this.labelDopColor.DragEnter += new System.Windows.Forms.DragEventHandler(this.LabelColor_DragEnter);
|
||||
//
|
||||
// labelColor
|
||||
//
|
||||
|
@ -117,18 +117,10 @@ namespace Bus
|
||||
|
||||
private void LabelDopColor_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
var color = e.Data.GetData(typeof(Color));
|
||||
if (color != null)
|
||||
if (_bus != null && _bus.Bus is EntitySportBus entityAirbus)
|
||||
{
|
||||
(sender as Label).BackColor = (Color)color;
|
||||
}
|
||||
if (_bus != null)
|
||||
{
|
||||
if (_bus is DrawingSportBus bus)
|
||||
{
|
||||
bus.SetDopColor((Color)color);
|
||||
DrawBus();
|
||||
}
|
||||
entityAirbus.DopColor = (Color)e.Data.GetData(typeof(Color));
|
||||
|
||||
DrawBus();
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Bus
|
||||
comboBoxSelectorMap.Items.Clear();
|
||||
foreach (var item in _mapsDict)
|
||||
{
|
||||
comboBoxSelectorMap.Items.Add(item.Key);
|
||||
comboBoxSelectorMap.Items.Add(item.Key);//
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ namespace Bus
|
||||
|
||||
public void AddMap(string name, AbstractMap map)
|
||||
{
|
||||
if (_mapStorages.ContainsKey(name)) return; //уникальное имя
|
||||
if (_mapStorages.ContainsKey(name)) return;
|
||||
else
|
||||
{
|
||||
_mapStorages.Add(name, new MapWithSetDoubleDeckerBusGeneric<DrawingObjectBus, AbstractMap>(_pictureWidth, _pictureHeight, map));
|
||||
@ -34,19 +34,18 @@ namespace Bus
|
||||
|
||||
public void DelMap(string name)
|
||||
{
|
||||
// TODO Прописать логику для удаления
|
||||
// TODO проверяет наличие элемента с определенным ключом
|
||||
if (_mapStorages.ContainsKey(name))
|
||||
{
|
||||
_mapStorages.Remove(name);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public MapWithSetDoubleDeckerBusGeneric<DrawingObjectBus, AbstractMap> this[string ind]
|
||||
public MapWithSetDoubleDeckerBusGeneric<DrawingObjectBus, AbstractMap> this[string ind] // инициализация индексатора
|
||||
{
|
||||
get
|
||||
{
|
||||
// TODO Продумать логику получения объекта
|
||||
// TODO получает из словаря элемент по ключу
|
||||
_mapStorages.TryGetValue(ind, out var MapWithSetDoubleDeckerBusGeneric);
|
||||
return MapWithSetDoubleDeckerBusGeneric;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user