public override void Close() { VerifyResult(_cco.Close()); _cco.DirectIOEvent -= (POS.Devices._IOPOSBillDispenserEvents_DirectIOEventEventHandler)_cco_DirectIOEvent; _cco.StatusUpdateEvent -= (POS.Devices._IOPOSBillDispenserEvents_StatusUpdateEventEventHandler)_cco_StatusUpdateEvent; _cco = null; }
protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { // TODO: Discard the managed state (managed object). } if (_cco != null) { _cco.DirectIOEvent -= (POS.Devices._IOPOSBillDispenserEvents_DirectIOEventEventHandler)_cco_DirectIOEvent; _cco.StatusUpdateEvent -= (POS.Devices._IOPOSBillDispenserEvents_StatusUpdateEventEventHandler)_cco_StatusUpdateEvent; _cco = null; } _disposedValue = true; } }
public override void Open() { if (string.IsNullOrWhiteSpace(_oposDeviceName)) { try { _oposDeviceName = GetConfigurationProperty("OposDeviceName"); _oposDeviceName.Trim(); } catch { _oposDeviceName = ""; } } if (string.IsNullOrWhiteSpace(_oposDeviceName)) { string strMessage = "OposDeviceName is not configured on " + DevicePath + "."; throw new Microsoft.PointOfService.PosControlException(strMessage, ErrorCode.NoExist); } if (_cco == null) { try { // CCO object CreateInstance _cco = new POS.Devices.OPOSBillDispenser(); // Register event handler _cco.DirectIOEvent += new _IOPOSBillDispenserEvents_DirectIOEventEventHandler(_cco_DirectIOEvent); _cco.StatusUpdateEvent += new _IOPOSBillDispenserEvents_StatusUpdateEventEventHandler(_cco_StatusUpdateEvent); } catch { string strMessage = "Can not create Common ControlObject on " + DevicePath + "."; throw new Microsoft.PointOfService.PosControlException(strMessage, ErrorCode.Failure); } } VerifyResult(_cco.Open(_oposDeviceName)); }
public OpenPOSBillDispenser() { _cco = null; _oposDeviceName = ""; _binaryConversion = 0; }