示例#1
0
 /// <summary>
 /// Recovers backed up Intervention instances that were active.
 /// </summary>
 private void RecoverActiveInterventions()
 {
     if (Recoverable())
     {
         String[] filenames = Directory.GetFiles(outputDirectory, "ActiveIntervention*.tmp");
         if (filenames.Length > 0)
         {
             foreach (string fn in filenames)
             {
                 try
                 {
                     fileStream = File.OpenRead(fn);
                     Intervention temp = (Intervention)serializer.Deserialize(fileStream);
                     if (temp.getInterveningTeamList().Count >= 1)
                     {
                         throw(new Exception());
                     }
                     Intervention.AddActiveIntervention(temp);
                     fileStream.Close();
                 }
                 catch (Exception ex)
                 {
                     LogException(ex);
                 }
             }
         }
     }
 }