From 40d5e0ce5f7fed24a44637c59b1b3d39af846045 Mon Sep 17 00:00:00 2001 From: F1rsTTeaM Date: Thu, 18 Apr 2024 17:45:48 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=BE=D0=B2=20=D1=81?= =?UTF-8?q?=D0=BE=D0=B1=D1=81=D1=82=D0=B2=D0=B5=D0=BD=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exceptions/CollectionOverflowException.cs | 21 +++++++++++++++++++ .../Exceptions/ObjectNotFoundException.cs | 21 +++++++++++++++++++ .../PositionOutOfCollectionException.cs | 21 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/CollectionOverflowException.cs create mode 100644 AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/ObjectNotFoundException.cs create mode 100644 AirplaneWithRadar/ProjectAirplaneWithRadar/Exceptions/PositionOutOfCollectionException.cs 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) { } + } +}