Готовая пятая лабораторная работа.

This commit is contained in:
Anastasia 2022-12-18 12:07:19 +04:00
parent dd63332041
commit 71311d9505
2 changed files with 7 additions and 9 deletions

View File

@ -16,7 +16,7 @@ namespace AirplaneWithRadar
public partial class FormAirplaneConfig : Form public partial class FormAirplaneConfig : Form
{ {
/// <summary> /// <summary>
/// Переменная-выбранная машина /// Переменная-выбранный самолет
/// </summary> /// </summary>
DrawingAirplane _airplane = null; DrawingAirplane _airplane = null;
/// <summary> /// <summary>
@ -40,7 +40,6 @@ namespace AirplaneWithRadar
// TODO buttonCancel.Click with lambda // TODO buttonCancel.Click with lambda
buttonCancel.Click += (object sender, EventArgs e) => Close(); buttonCancel.Click += (object sender, EventArgs e) => Close();
} }
/// <summary> /// <summary>
/// Отрисовать самолет /// Отрисовать самолет
/// </summary> /// </summary>
@ -143,7 +142,6 @@ namespace AirplaneWithRadar
/// <param name="e"></param> /// <param name="e"></param>
private void LabelBaseColor_DragDrop(object sender, DragEventArgs e) private void LabelBaseColor_DragDrop(object sender, DragEventArgs e)
{ {
// TODO Call method from object _car and set color
Color BodyColor = (Color)e.Data.GetData(typeof(Color)); Color BodyColor = (Color)e.Data.GetData(typeof(Color));
_airplane.SetColor(BodyColor); _airplane.SetColor(BodyColor);
DrawAirplane(); DrawAirplane();
@ -155,7 +153,6 @@ namespace AirplaneWithRadar
/// <param name="e"></param> /// <param name="e"></param>
private void LabelDopColor_DragDrop(object sender, DragEventArgs e) private void LabelDopColor_DragDrop(object sender, DragEventArgs e)
{ {
// TODO Call method from object _car if _car is DrawningSportCar and set dop color
Color ModifColor = (Color)e.Data.GetData(typeof(Color)); Color ModifColor = (Color)e.Data.GetData(typeof(Color));
if (_airplane is DrawingAirplaneWithRadar airplaneWithRadar) if (_airplane is DrawingAirplaneWithRadar airplaneWithRadar)
{ {
@ -164,13 +161,10 @@ namespace AirplaneWithRadar
} }
} }
/// <summary> /// <summary>
/// Добавление машины /// Добавление самолета
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void ButtonOk_Click(object sender, EventArgs e) private void ButtonOk_Click(object sender, EventArgs e)
{ {
EventAddAirplane?.Invoke(_airplane); EventAddAirplane?.Invoke(_airplane);

View File

@ -48,7 +48,11 @@ namespace AirplaneWithRadar
SetData(); SetData();
Draw(); Draw();
} }
/// <summary>
/// Ïåðåìåùåíèå
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonMove_Click(object sender, EventArgs e) private void ButtonMove_Click(object sender, EventArgs e)
{ {
string name = ((Button)sender)?.Name ?? string.Empty; string name = ((Button)sender)?.Name ?? string.Empty;