diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/CollectionOverflowException.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/CollectionOverflowException.cs new file mode 100644 index 0000000..8f9d766 --- /dev/null +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/CollectionOverflowException.cs @@ -0,0 +1,21 @@ +using System.Runtime.Serialization; + +namespace ProjectAirplaneWithRadar.Exceptions +{ + /// + /// Класс, описывающий ошибку переполнения коллекции + /// + [Serializable] + internal class CollectionOverflowException : ApplicationException + { + public CollectionOverflowException(int count) : base("В коллекции превышено допустимое количество: " + count) { } + + public CollectionOverflowException() : base() { } + + public CollectionOverflowException(string message) : base(message) { } + + public CollectionOverflowException(string message, Exception exception) : base(message, exception) { } + + protected CollectionOverflowException(SerializationInfo info, StreamingContext contex) : base(info, contex) { } + } +} diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/ObjectNotFoundException.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/ObjectNotFoundException.cs new file mode 100644 index 0000000..08e76a3 --- /dev/null +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/ObjectNotFoundException.cs @@ -0,0 +1,21 @@ +using System.Runtime.Serialization; + +namespace ProjectAirplaneWithRadar.Exceptions +{ + /// + /// Класс, описывающий ошибку, что по указанной позиции нет элемента + /// + [Serializable] + internal class ObjectNotFoundException : ApplicationException + { + public ObjectNotFoundException(int i) : base("Не найден объект по позиции " + i) { } + + public ObjectNotFoundException() : base() { } + + public ObjectNotFoundException(string message) : base(message) { } + + public ObjectNotFoundException(string message, Exception exception) : base(message, exception) { } + + protected ObjectNotFoundException(SerializationInfo info, StreamingContext contex) : base(info, contex) { } + } +} diff --git a/AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/PositionOutOfCollectionException.cs b/AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/PositionOutOfCollectionException.cs new file mode 100644 index 0000000..7ec324b --- /dev/null +++ b/AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/PositionOutOfCollectionException.cs @@ -0,0 +1,21 @@ +using System.Runtime.Serialization; + +namespace ProjectAirplaneWithRadar.Exceptions +{ + /// + /// Класс, описывающий ошибку выхода за границы коллекции + /// + [Serializable] + internal class PositionOutOfCollectionException : ApplicationException + { + public PositionOutOfCollectionException(int i) : base("Выход за границы коллекции. Позиция " + i) { } + + public PositionOutOfCollectionException() : base() { } + + public PositionOutOfCollectionException(string message) : base(message) { } + + public PositionOutOfCollectionException(string message, Exception exception) : base(message, exception) { } + + protected PositionOutOfCollectionException(SerializationInfo info, StreamingContext contex) : base(info, contex) { } + } +}