PIbd-23 Firsov Kirill LabWork 06 #26

Closed
Firsov_Kirill wants to merge 6 commits from Laba6 into Laba5.1
3 changed files with 50 additions and 3 deletions
Showing only changes of commit 47cf7a6743 - Show all commits

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace ProjectTractor.Exceptions
{
[Serializable]
internal class CarNotFoundException : ApplicationException
{
public CarNotFoundException(int i) : base($"Не найден объект по позиции { i}") { }
public CarNotFoundException() : base() { }
public CarNotFoundException(string message) : base(message) { }
public CarNotFoundException(string message, Exception exception) :
base(message, exception)
{ }
protected CarNotFoundException(SerializationInfo info,
StreamingContext contex) : base(info, contex) { }
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace ProjectTractor.Exceptions
{
[Serializable]
internal class StorageOverflowException : ApplicationException
{
public StorageOverflowException(int count) : base($"В наборе превышено допустимое количество: { count}") { }
public StorageOverflowException() : base() { }
public StorageOverflowException(string message) : base(message) { }
public StorageOverflowException(string message, Exception exception)
: base(message, exception) { }
protected StorageOverflowException(SerializationInfo info,
StreamingContext contex) : base(info, contex) { }
}
}

View File

@ -158,10 +158,10 @@ namespace ProjectTractor
string[] set = record[1].Split(_separatorRecords, StringSplitOptions.RemoveEmptyEntries);
foreach (string elem in set)
{
DrawningTractor? bus = elem?.CreateDrawningTractor(_separatorForObject, _pictureWidth, _pictureHeight);
if (bus != null)
DrawningTractor? tractor = elem?.CreateDrawningTractor(_separatorForObject, _pictureWidth, _pictureHeight);
if (tractor != null)
{
if (!(collection + bus))
if (!(collection + tractor))
{
return false;
}