Боровков М В ПИбд-22 5 лабораторная работа #6

Closed
bekodeg wants to merge 4 commits from labWork5 into labWork4
3 changed files with 5 additions and 18 deletions
Showing only changes of commit d03960db79 - Show all commits

View File

@ -299,7 +299,6 @@
buttonClose.TabIndex = 11;
buttonClose.Text = "Отмена";
buttonClose.UseVisualStyleBackColor = true;
buttonClose.Click += buttonClose_Click;
//
// panelObject
//

View File

@ -50,10 +50,5 @@ namespace ProjectElectricLocomotive
{
ButtonOk_Click(sender, e);
}
private void buttonClose_Click(object sender, EventArgs e)
{
ButtonClose_Click(sender, e);
}
}
}

View File

@ -36,6 +36,7 @@ namespace ProjectElectricLocomotive
panelYellow.MouseDown += PanelColor_MouseDown;
panelBlue.MouseDown += PanelColor_MouseDown;
// TODO buttonCancel.Click with lambda
buttonClose.Click += (sender, e) => Close();
}
/// <summary>
@ -192,18 +193,10 @@ namespace ProjectElectricLocomotive
/// <param name="e"></param>
private void ButtonOk_Click(object sender, EventArgs e)
{
EventAddLocomotive?.Invoke(_locomotive);
Close();
}
/// <summary>
/// Отмена Добавления локомотива
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonClose_Click(object sender, EventArgs e)
{
EventAddLocomotive?.Invoke(_locomotive);
if (_locomotive is not null)
{
EventAddLocomotive?.Invoke(_locomotive);
}
Close();
}
}