PIbd-11.Basalov.A.D.LabWork07.Simple #14

Closed
Tonby73 wants to merge 5 commits from LabWork7 into LabWork6
Showing only changes of commit c702afd01e - Show all commits

View File

@ -192,11 +192,11 @@ where T : DrawningLocomotive
string[] set = record[3].Split(_separatorItems, StringSplitOptions.RemoveEmptyEntries);
foreach (string elem in set)
{
if (elem?.CreateDrawningLocomotive() is T truck)
if (elem?.CreateDrawningLocomotive() is T locomotive)
{
try
{
if (collection.Insert(truck) == -1)
if (collection.Insert(locomotive) == -1)
{
throw new Exception("Объект не удалось добавить в коллекцию: " + record[3]);
}