Exemple #1
0
 /// <summary>
 /// Вывод списка со всеми элементами
 /// </summary>
 static void DataOutput()
 {
     try
     {
         persons1.CheckLength();
         ShowList(persons1);
     }
     catch (Exception exception)
     {
         if (exception is ArgumentException ||
             exception is IndexOutOfRangeException)
         {
             Console.WriteLine($"{exception.Message}\n");
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Вывод первого и второго списка людей
 /// </summary>
 /// <param name="personsFirst">Первый список людей</param>
 /// <param name="personsSecond">Второй список людей</param>
 static void ShowTwoLists(PersonList personsFirst, PersonList
                          personsSecond)
 {
     Console.WriteLine("Первый список:\n");
     ShowList(personsFirst);
     Console.WriteLine("Второй список:\n");
     try
     {
         personsSecond.CheckLength();
         ShowList(personsSecond);
     }
     catch (ArgumentException argumentException)
     {
         Console.WriteLine($"{argumentException.Message}\n");
     }
 }