Exemple #1
0
 public static void OnProcessExit(object sender, EventArgs e)
 {
     if (currdev != null)
     {
         currdev.Disconnect();
     }
     currdev = null;
     if (CRD != null)
     {
         CRD.Dispose();
         CRD = null;
     }
     if (CPU != null)
     {
         CPU.Dispose();
         CPU = null;
     }
     if (MT != null)
     {
         for (int i = 0; i < MT.Length; i++)
         {
             if (MT[i] != null)
             {
                 MT[i].Dispose();
                 MT[i] = null;
             }
         }
     }
     if (DR != null)
     {
         for (int i = 0; i < DR.Length; i++)
         {
             if (DR[i] != null)
             {
                 DR[i].Dispose();
                 DR[i] = null;
             }
         }
     }
     if (LP != null)
     {
         LP.Dispose();
         LP = null;
     }
     if (LogCPU != null)
     {
         LogCPU.Dispose();
         LogCPU = null;
     }
     if (LogIO != null)
     {
         if (Config.LogIO != Config.LogCPU)
         {
             LogIO.Dispose();
         }
         LogIO = null;
     }
     Console.Error.WriteLine("finished");
 }
Exemple #2
0
 static void OpenCardReader()
 {
     if (CRD == null && Config.CRD != null)
     {
         CRD = new CardReader();
         CRD.MountDeck(Config.CRD);
     }
     if (CRD == null)
     {
         throw new InvalidOperationException("Invalid cardreader selected for read");
     }
 }