изменение кнопки на лямбду и исправление бага с добавлением ничего
This commit is contained in:
parent
e5a45732e9
commit
d03960db79
@ -299,7 +299,6 @@
|
||||
buttonClose.TabIndex = 11;
|
||||
buttonClose.Text = "Отмена";
|
||||
buttonClose.UseVisualStyleBackColor = true;
|
||||
buttonClose.Click += buttonClose_Click;
|
||||
//
|
||||
// panelObject
|
||||
//
|
||||
|
@ -50,10 +50,5 @@ namespace ProjectElectricLocomotive
|
||||
{
|
||||
ButtonOk_Click(sender, e);
|
||||
}
|
||||
|
||||
private void buttonClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
ButtonClose_Click(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user