Изменена логика добавления обхекта в классе FormPlaneCollection

This commit is contained in:
Никита Потапов 2023-11-06 13:36:28 +04:00
parent 0b208db4dd
commit 5a616231fd

View File

@ -94,6 +94,12 @@ namespace ProjectStormtrooper
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonAddPlane_Click(object sender, EventArgs e)
{
var formPlaneConfig = new FormPlaneConfig();
formPlaneConfig.AddEvent(new PlaneDelegate(AddPlaneListener));
formPlaneConfig.Show();
}
public void AddPlaneListener(DrawingPlane plane)
{
if (listBoxStorages.SelectedIndex == -1)
{
@ -107,7 +113,7 @@ namespace ProjectStormtrooper
FormStormtrooper form = new();
if (form.ShowDialog() == DialogResult.OK)
{
if (obj + form.SelectedPlane > -1)
if (obj + plane > -1)
{
MessageBox.Show("Объект добавлен");
pictureBoxCollection.Image = obj.ShowPlanes();