Beispiel #1
0
 /// <summary>
 /// Вывод структуры в консоль
 /// </summary>
 public static void ShowStructure(PersonBase person)
 {
     if (person.GetType() == typeof(Adult))
     {
         Console.WriteLine("{0,-14} | {1,-14} | {2,-10} | {3,-10} " +
                           "| {4,-16} | {5, -13} | {6, -13}", "Имя", "Фамилия",
                           "Возраст", "Пол", "Состояние брака", "Работа", "Супруг");
     }
     else if (person.GetType() == typeof(Child))
     {
         Console.WriteLine("{0,-14} | {1,-14} | {2,-10} | {3,-10} " +
                           "| {4,-16} | {5, -13} | {6, -13}", "Имя", "Фамилия",
                           "Возраст", "Пол", "Состав семьи", "Детский сад", "Родители");
     }
 }