лаб 7 готовая полностью

This commit is contained in:
Anya 2024-06-17 01:24:22 +04:00
parent 8aea0aebc3
commit f000dd4b40

View File

@ -39,7 +39,7 @@ public partial class FormSimpleBusCollection : Form
{ {
switch (comboBoxSelectorCompany.Text) switch (comboBoxSelectorCompany.Text)
{ {
case "Хранилище": case "хранилище":
_company = new BusStation(pictureBox.Width, pictureBox.Height, _company = new BusStation(pictureBox.Width, pictureBox.Height,
new MassiveGenericObjects<DrawningSimpleBus>()); new MassiveGenericObjects<DrawningSimpleBus>());
break; break;
@ -169,15 +169,12 @@ public partial class FormSimpleBusCollection : Form
/// <param name="e"></param> /// <param name="e"></param>
private void ButtonRefresh_Click(object sender, EventArgs e) private void ButtonRefresh_Click(object sender, EventArgs e)
{ {
listBoxCollection.Items.Clear(); if (_company == null)
for (int i = 0; i < _storageCollection.Keys?.Count; ++i)
{ {
string? colName = _storageCollection.Keys?[i]; return;
if (!string.IsNullOrEmpty(colName))
{
listBoxCollection.Items.Add(colName);
}
} }
pictureBox.Image = _company.Show();
} }
/// <summary> /// <summary>
@ -320,7 +317,7 @@ public partial class FormSimpleBusCollection : Form
switch (comboBoxSelectorCompany.Text) switch (comboBoxSelectorCompany.Text)
{ {
case "Хранилище": case "хранилище":
_company = new BusStation(pictureBox.Width, pictureBox.Height, collection); _company = new BusStation(pictureBox.Width, pictureBox.Height, collection);
_logger.LogInformation("Компания создана"); _logger.LogInformation("Компания создана");
break; break;