PIbd-11.Basalov.A.D.LabWork07.Simple #14
@ -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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user