From 3a938f63494014cfb9c6ed468969039680365c4d Mon Sep 17 00:00:00 2001 From: Aleksandr4350 Date: Fri, 14 Jun 2024 08:14:29 +0400 Subject: [PATCH] , --- .../CollectionGenericObjects/MassiveGenericObjects.cs | 2 +- .../ProjectSportCar/Exceptions/ObjectNotFoundException.cs | 2 +- ProjectSportCar/ProjectSportCar/FormPlaneCollection.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs index 7c0b71b..cd89687 100644 --- a/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/ProjectSportCar/ProjectSportCar/CollectionGenericObjects/MassiveGenericObjects.cs @@ -119,7 +119,7 @@ where T : class { throw new PositionOutOfCollectionException(position); } - if (_collection[position] == null) throw new ObjectNotFoundException(position); + if (_collection[position] == null) throw new ObjectNotFoundException(position);//выброс1 T obj = _collection[position]; _collection[position] = null; return obj; diff --git a/ProjectSportCar/ProjectSportCar/Exceptions/ObjectNotFoundException.cs b/ProjectSportCar/ProjectSportCar/Exceptions/ObjectNotFoundException.cs index a239c59..d2d9d0e 100644 --- a/ProjectSportCar/ProjectSportCar/Exceptions/ObjectNotFoundException.cs +++ b/ProjectSportCar/ProjectSportCar/Exceptions/ObjectNotFoundException.cs @@ -9,7 +9,7 @@ namespace ProjectAiroplane.Exceptions; [Serializable] internal class ObjectNotFoundException : ApplicationException { - public ObjectNotFoundException(int i) : base("Не найден объект по позиции " + i) { } + public ObjectNotFoundException(int i) : base("Не найден объект по позиции " + i) { }//обработка1 public ObjectNotFoundException() : base() { } diff --git a/ProjectSportCar/ProjectSportCar/FormPlaneCollection.cs b/ProjectSportCar/ProjectSportCar/FormPlaneCollection.cs index e6968b6..5949fca 100644 --- a/ProjectSportCar/ProjectSportCar/FormPlaneCollection.cs +++ b/ProjectSportCar/ProjectSportCar/FormPlaneCollection.cs @@ -77,7 +77,7 @@ public partial class FormPlaneCollection : Form } } - catch (ObjectNotFoundException) { MessageBox.Show("Не удалось добавить объект"); + catch (ObjectNotFoundException) { MessageBox.Show("Не удалось добавить объект");//ловлю ошибку1 }