Morozov V.S. LabWork05 #6

Closed
VoldemarProger wants to merge 4 commits from LabWork05 into LabWork04
3 changed files with 29 additions and 23 deletions
Showing only changes of commit ab9fdf006d - Show all commits

View File

@ -86,26 +86,8 @@ namespace AirPlaneWithRadar
private void ButtonAddPlain_Click(object sender, EventArgs e)
{
if (listBoxMaps.SelectedIndex == -1)
{
return;
}
FormPlain form = new();
if (form.ShowDialog() == DialogResult.OK)
{
DrawingObjectPlane plain = new(form.SelectedPlain);
if ((_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + plain) >= 0)
{
MessageBox.Show("Объект добавлен");
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
}
else
{
MessageBox.Show("Не удалось добавить объект");
}
}
var formPlainConfig = new FormPlaneConfig();
formPlainConfig.Show();
}
private void ButtonRemovePlain_Click(object sender, EventArgs e)
{

View File

@ -14,7 +14,7 @@ namespace AirPlaneWithRadar
{
DrawingPlain _Plane = null;
private event PlainDelegate EventAddPlane;
public FormPlaneConfig()
{
@ -40,7 +40,17 @@ namespace AirPlaneWithRadar
pictureBoxObject.Image = bmp;
}
public void AddEvent(PlainDelegate ev)
{
if (EventAddPlane == null)
{
EventAddPlane = ev;
}
else
{
EventAddPlane += ev;
}
}
private void LabelObject_MouseDown(object sender, MouseEventArgs e)
{
@ -119,7 +129,11 @@ namespace AirPlaneWithRadar
}
private void ButtonOk_Click(object sender, EventArgs e)
{
EventAddPlane?.Invoke(_Plane);
Close();
}
}
}

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirPlaneWithRadar
{
public delegate void PlainDelegate(DrawingPlain car);
Review

Не используется

Не используется
}