little buggs 7 lab
This commit is contained in:
parent
3749397f5e
commit
21c9ff5017
@ -78,11 +78,13 @@ namespace Laba1Loco
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show("Не удалось добавить объект");
|
MessageBox.Show("Не удалось добавить объект");
|
||||||
|
_logger.LogWarning($"добавление поезда неуспешно");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(ApplicationException ex)
|
catch(ApplicationException ex)
|
||||||
{
|
{
|
||||||
MessageBox.Show(ex.Message);
|
MessageBox.Show(ex.Message);
|
||||||
|
_logger.LogWarning($"добавление поезда неуспешно {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ namespace Laba1Loco
|
|||||||
public int Insert(T train)
|
public int Insert(T train)
|
||||||
{
|
{
|
||||||
if (_places.Count >= _maxCount)
|
if (_places.Count >= _maxCount)
|
||||||
throw new StorageOverflowException();
|
throw new StorageOverflowException(_places.Count);
|
||||||
_places.Insert(0, train);
|
_places.Insert(0, train);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ namespace Laba1Loco
|
|||||||
public bool Insert(T train, int position)
|
public bool Insert(T train, int position)
|
||||||
{
|
{
|
||||||
if (_places.Count >= _maxCount)
|
if (_places.Count >= _maxCount)
|
||||||
throw new StorageOverflowException(position);
|
throw new StorageOverflowException(_places.Count);
|
||||||
|
|
||||||
if (position < 0 || position > _places.Count)
|
if (position < 0 || position > _places.Count)
|
||||||
throw new TrainNotFoundException(position);
|
throw new TrainNotFoundException(position);
|
||||||
|
Loading…
Reference in New Issue
Block a user