Exemplo n.º 1
0
 public void HandleFileOversizing(object sender, MessageArgs args) //для обробки події при переповненні файлу
 {
     Console.WriteLine(FileName + " " + args.DisplayMessage);
     Console.WriteLine("If you want to save some data in the file , press <Y>, otherwise the entry in the file is not going to happen!");
     if (Convert.ToChar(Console.ReadLine().ToUpper()) == 'Y')
     {
         writeSomeDataToFile(args.DataInBytes);
         readSomeDataFromFile();
     }
 }
 public void HandleFileOversizing(object sender, MessageArgs args) //для обробки події при переповненні файлу
 {
     Console.WriteLine(FileName + " " + args.DisplayMessage);
     Console.WriteLine("If you want to save some data in the file , press <Y>, otherwise the entry in the file is not going to happen!");
     if (Convert.ToChar(Console.ReadLine().ToUpper()) == 'Y')
     {
         writeSomeDataToFile(args.DataInBytes);
         try
         {
             readSomeDataFromFile();
         }
         catch (SerializationException)
         {
             Console.WriteLine("Your data is incorrect recorded");
         }
         catch (Exception ex)
         {
             Console.WriteLine("Error -> {0}", ex.Message);
         }
     }
 }