PIbd-21. Makarov D.V. Lab work 04 #4
@ -18,11 +18,13 @@ namespace AirplaneWithRadar.Generics
|
||||
|
||||
public void AddSet(string name)
|
||||
{
|
||||
if (airplaneStorages.ContainsKey(name)) { return; }
|
||||
airplaneStorages.Add(name, new AirplanesGenericCollection<PaintAirplane, PaintObjectAirplane>(pictWidth, pictHeight));
|
||||
}
|
||||
public void DelSet(string name)
|
||||
{
|
||||
airplaneStorages.Remove(name);
|
||||
if (airplaneStorages.ContainsKey(name))
|
||||
airplaneStorages.Remove(name);
|
||||
}
|
||||
public AirplanesGenericCollection<PaintAirplane, PaintObjectAirplane>? this[string ind]
|
||||
{
|
||||
|
@ -50,12 +50,11 @@ namespace AirplaneWithRadar
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (MessageBox.Show($"Удалить объект { listBoxStorages.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
if (MessageBox.Show($"Удалить объект {listBoxStorages.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
storage.DelSet(listBoxStorages.SelectedItem.ToString() ?? string.Empty);
|
||||
ReloadObjects();
|
||||
}
|
||||
|
||||
}
|
||||
private void ButtonAddAirplane_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user