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"); }
static void OpenCardPunch() { if (CPU == null && Config.CPU != null) { CPU = new CardPunch(); CPU.MountDeck(Config.CPU); } if (CPU == null) { throw new InvalidOperationException("Invalid CardPunch selected for write"); } }