Exemplo n.º 1
0
 private void newMaxValue(ICounter obj)
 {
     Console.Write("New maximal value of counter - ");
     try
     {
         var result = int.Parse(Console.ReadLine());
         if (result <= obj.Min)
         {
             throw new FormatException();
         }
         obj.End(result);
     }
     catch (FormatException e)
     {
         Console.WriteLine("Please enter valid date!");
         Console.WriteLine();
         newMaxValue(obj);
     }
 }