файлы лабораторной
This commit is contained in:
parent
60f34c49b3
commit
0208828b09
@ -66,19 +66,9 @@ namespace ProjectLainer
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LainerForm form = new();
|
var formLinerConfig = new FormLainerConfig();
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
formLinerConfig.AddEvent(AddLainer);
|
||||||
{
|
formLinerConfig.Show();
|
||||||
if (obj + form.SelectedLainer)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Объект добавлен");
|
|
||||||
pictureBoxCollection.Image = obj.ShowLainers();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Не удалось добавить объект");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
private void ButtonRemove_Click(object sender, EventArgs e)
|
private void ButtonRemove_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@ -126,5 +116,26 @@ namespace ProjectLainer
|
|||||||
{
|
{
|
||||||
pictureBoxCollection.Image = _storage[listBoxStorages.SelectedItem?.ToString() ?? string.Empty]?.ShowLainers();
|
pictureBoxCollection.Image = _storage[listBoxStorages.SelectedItem?.ToString() ?? string.Empty]?.ShowLainers();
|
||||||
}
|
}
|
||||||
|
private void AddLainer(DrawingEntity lainer)
|
||||||
|
{
|
||||||
|
if (listBoxStorages.SelectedIndex == -1)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var obj = _storage[listBoxStorages.SelectedItem.ToString() ?? string.Empty];
|
||||||
|
if (obj == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (obj + lainer)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Объект добавлен");
|
||||||
|
pictureBoxCollection.Image = obj.ShowLainers();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось добавить объект");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
lainer/Lainer1/LainerDelegate.cs
Normal file
11
lainer/Lainer1/LainerDelegate.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ProjectLainer.DrawningObjects;
|
||||||
|
|
||||||
|
namespace Lainers
|
||||||
|
{
|
||||||
|
public delegate void LainerDelegate(DrawingEntity lainer);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user