Пример #1
0
 private static void GameManagerDestructor(object sender, EventArgs e)
 {
     try
     {
         Stop();
         InformationManager.Stop();
         BinaryFormatter formatter = new BinaryFormatter();
         using (FileStream fs = new FileStream(BackupFileName, FileMode.Create))
         {
             lock (games)
             {
                 formatter.Serialize(fs, games);
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Log(ex);
         throw ex;
     }
 }