Лабораторная работа №5
This commit is contained in:
parent
874486dd20
commit
ce51be30a4
@ -28,6 +28,8 @@ public class DrawningAccordionBus : DrawningBus
|
||||
|
||||
Brush brushBlue = new SolidBrush(Color.Blue);
|
||||
// отсек
|
||||
if (accordionBus.Compartment)
|
||||
{
|
||||
g.FillRectangle(additionalBrush, _startPosX.Value + 60, _startPosY.Value, 50, 30);
|
||||
g.FillRectangle(additionalBrush, _startPosX.Value + 50, _startPosY.Value + 5, 10, 20);
|
||||
|
||||
@ -59,4 +61,5 @@ public class DrawningAccordionBus : DrawningBus
|
||||
g.DrawEllipse(pen, _startPosX.Value + 90, _startPosY.Value + 5, 5, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -327,7 +327,6 @@
|
||||
labelBodyColor.TabIndex = 2;
|
||||
labelBodyColor.Text = "Цвет";
|
||||
labelBodyColor.TextAlign = ContentAlignment.MiddleCenter;
|
||||
labelBodyColor.Click += labelBodyColor_Click;
|
||||
labelBodyColor.DragDrop += labelBodyColor_DragDrop;
|
||||
labelBodyColor.DragEnter += labelBodyColor_DragEnter;
|
||||
//
|
||||
|
@ -17,9 +17,9 @@ public partial class FormBusConfig : Form
|
||||
/// <summary>
|
||||
/// Объект прорисовки класса
|
||||
/// </summary>
|
||||
private DrawningBus? _bus;
|
||||
private DrawningBus? _bus = null;
|
||||
|
||||
private event BusDelegate? _busDelegate;
|
||||
private event Action<DrawningAccordionBus>? BusDelegate;
|
||||
|
||||
/// <summary>
|
||||
/// Конструктор
|
||||
@ -40,9 +40,9 @@ public partial class FormBusConfig : Form
|
||||
buttonCancel.Click += (sender, e) => Close();
|
||||
}
|
||||
|
||||
public void AddEvent(BusDelegate busDelegate)
|
||||
public void AddEvent(Action<DrawningAccordionBus> busDelegate)
|
||||
{
|
||||
_busDelegate += busDelegate;
|
||||
BusDelegate += busDelegate;
|
||||
}
|
||||
|
||||
// <summary>
|
||||
@ -92,8 +92,7 @@ public partial class FormBusConfig : Form
|
||||
(double)numericUpDownWeight.Value, Color.White);
|
||||
break;
|
||||
case "labelModifiedObject":
|
||||
_bus = new
|
||||
DrawningAccordionBus((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value,
|
||||
_bus = new DrawningAccordionBus((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value,
|
||||
Color.White,
|
||||
Color.Black, checkBoxCompartment.Checked,
|
||||
checkBoxEntrance.Checked, checkBoxWindows.Checked);
|
||||
@ -113,7 +112,7 @@ public partial class FormBusConfig : Form
|
||||
{
|
||||
if (_bus != null)
|
||||
{
|
||||
_busDelegate?.Invoke(_bus);
|
||||
BusDelegate?.Invoke((DrawningAccordionBus)_bus);
|
||||
Close();
|
||||
}
|
||||
}
|
||||
@ -161,11 +160,5 @@ public partial class FormBusConfig : Form
|
||||
_accordionBus.SetAdditionalColor((Color)e.Data.GetData(typeof(Color)));
|
||||
}
|
||||
DrawObject();
|
||||
|
||||
}
|
||||
|
||||
private void labelBodyColor_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user