public override void Open() { // Device State checking done in base class base.Open(); // Initialize the CheckHealthText property to an empty string checkhealthtext = ""; // Set values for common statistics SetStatisticValue(StatisticManufacturerName, "Microsoft Corporation"); SetStatisticValue(StatisticManufactureDate, "2004-05-23"); SetStatisticValue(StatisticModelName, "PosPrinter Simulator"); SetStatisticValue(StatisticMechanicalRevision, "1.0"); SetStatisticValue(StatisticInterface, "Other"); Window = new PosPrinterSimulatorWindow(this); // set capabilities Properties.CapPowerReporting = PowerReporting.Standard; Properties.CapRecPresent = true; Properties.CapRecEmptySensor = true; Properties.CapRecNearEndSensor = true; Properties.RecEmpty = false; Properties.RecNearEnd = false; Properties.CapRecPaperCut = true; Properties.CapTransaction = true; Properties.CapRecRight90 = true; Properties.CapRecRotate180 = true; Properties.CapRecLeft90 = true; Properties.CapCoverSensor = true; Properties.CapSlpPresent = true; Properties.CapSlpEmptySensor = true; Properties.CapSlpNearEndSensor = true; Properties.SlpEmpty = false; Properties.SlpNearEnd = false; Properties.CapRecBarCode = true; Properties.RecBarCodeRotationList = new Rotation [] { Rotation.Normal, Rotation.Right90, Rotation.Left90, Rotation.Rotate180 }; Properties.CapRecRuledLine = LineDirection.Horizontal | LineDirection.Vertical; Properties.CapSlpRuledLine = LineDirection.Horizontal | LineDirection.Vertical; }
protected override void Dispose(bool disposing) { try { if(disposing) { Logger.Info("PosPrinterSimulator", "Disposing class: " + this.ToString()); // Release the managed resources you added in // this derived class here. } // Release the native unmanaged resources // Win needs to be treated as an unmanaged resource because // it is a class that contain threads and windows and won't get collected // by the GC if (Window != null) { Window.Close(); Window = null; } } finally { base.Dispose(disposing); } }
public override void Open() { // Device State checking done in base class base.Open(); // Initialize the CheckHealthText property to an empty string checkhealthtext = ""; // Set values for common statistics SetStatisticValue(StatisticManufacturerName, "Microsoft Corporation"); SetStatisticValue(StatisticManufactureDate, "2004-05-23"); SetStatisticValue(StatisticModelName, "PosPrinter Simulator"); SetStatisticValue(StatisticMechanicalRevision, "1.0"); SetStatisticValue(StatisticInterface, "Other"); Window = new PosPrinterSimulatorWindow(this); // set capabilities Properties.CapPowerReporting = PowerReporting.Standard; Properties.CapRecPresent = true; Properties.CapRecEmptySensor = true; Properties.CapRecNearEndSensor = true; Properties.RecEmpty = false; Properties.RecNearEnd = false; Properties.CapRecPaperCut = true; Properties.CapTransaction = true; Properties.CapRecRight90 = true; Properties.CapRecRotate180 = true; Properties.CapRecLeft90 = true; Properties.CapCoverSensor = true; Properties.CapSlpPresent = true; Properties.CapSlpEmptySensor = true; Properties.CapSlpNearEndSensor = true; Properties.SlpEmpty = false; Properties.SlpNearEnd = false; Properties.CapRecBarCode = true; Properties.RecBarCodeRotationList = new Rotation [] {Rotation.Normal, Rotation.Right90, Rotation.Left90, Rotation.Rotate180}; }