Третья лабораторная работа

This commit is contained in:
10Г Егор Романов 2022-10-10 19:53:02 +03:00
parent e60bac054a
commit acb396e653
2 changed files with 9 additions and 11 deletions

View File

@ -30,7 +30,7 @@ namespace HoistingCrane
break; break;
case "Вторая карта": case "Вторая карта":
map = new SecondMap(); map = new SecondMap();
break; break;
} }
if (map != null) if (map != null)
{ {
@ -54,18 +54,17 @@ namespace HoistingCrane
formHoistingCraneConfig.Show(); formHoistingCraneConfig.Show();
} }
private void AddHoistingCrane(DrawingHoistingCrane drawingHoistingCrane) private void AddHoistingCrane(DrawingHoistingCrane drawingHoistingCrane)
{
DrawingObjectHoistingCrane hoistingCrane = new DrawingObjectHoistingCrane(drawingHoistingCrane);
if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + hoistingCrane != -1)
{ {
MessageBox.Show("Объект добавлен"); {
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet(); MessageBox.Show("Объект добавлен");
} }
else else
{ {
MessageBox.Show("Не удалось добавить объект"); MessageBox.Show("Не удалось добавить объект");
}
} }
} }
private void ButtonRemoveHoistingCrane_Click(object sender, EventArgs e) private void ButtonRemoveHoistingCrane_Click(object sender, EventArgs e)
{ {
if (string.IsNullOrEmpty(maskedTextBoxPosition.Text)) if (string.IsNullOrEmpty(maskedTextBoxPosition.Text))

View File

@ -107,7 +107,6 @@ namespace HoistingCrane
} }
} }
private void DrawHoistingCranes(Graphics gr)
{ {
int heightEl = _pictureHeight / _placeSizeHeight; int heightEl = _pictureHeight / _placeSizeHeight;
int widthEl = _pictureWidth / _placeSizeWidth; int widthEl = _pictureWidth / _placeSizeWidth;