public override void Connect(ConnectParametersCollection parameters) { try { if (!Connector.IsConnected) { Connector.Connect(); #if DEBUG_PORTS Debug.WriteLine("Connector: OPENED:"); Debug.WriteLine("Connector: start of call stack"); StackTrace trace = new StackTrace(); foreach (StackFrame frame in trace.GetFrames()) { MethodBase meth = frame.GetMethod(); Debug.WriteLine(meth.DeclaringType.FullName + "." + meth.Name); } Debug.WriteLine("Connector: end of call stack"); #endif } Initialize(); } catch (Exception ex) { Disconnect(); throw new HardwareErrorException(new ErrorState(ErrorState.KitchenPrinterDisconnected, HardwareErrorSeverity.Error), ex); } }
public override void Connect(ConnectParametersCollection parameters) { if (!Connector.IsConnected) { Connector.SetPortName(parameters); Connector.SetBaudRate(parameters); SetEncoding(WINDOWS_CYR_CODE_PAGE); } base.Connect(parameters); }
public override void Connect(ConnectParametersCollection parameters) { try { try { if (!Connector.IsConnected) { Connector.Connect(); } Initialize(); } catch (IOException ioex) { throw new HardwareErrorException(new ErrorState(ErrorState.BadSerialPort, HardwareErrorSeverity.Error), ioex); } catch (UnauthorizedAccessException uaex) { throw new HardwareErrorException(new ErrorState(ErrorState.BadSerialPort, HardwareErrorSeverity.Error), uaex); } } catch (Exception) { Disconnect(); throw; } }
public override void Connect(ConnectParametersCollection parameters) { try { if (!Connector.IsConnected) { Connector.Connect(); } if (messageTransceiver == null) { messageTransceiver = new Thread(MessageTransceiver); messageTransceiver.Start(); } Initialize(); } catch (IOException ioex) { throw new HardwareErrorException(new ErrorState(ErrorState.BadSerialPort, HardwareErrorSeverity.Error), ioex); } catch (UnauthorizedAccessException uaex) { throw new HardwareErrorException(new ErrorState(ErrorState.BadSerialPort, HardwareErrorSeverity.Error), uaex); } }
public override void Connect(ConnectParametersCollection parameters) { try { try { if (!Connector.IsConnected) { frameSeqNumber = 0x20; Connector.Connect(); #if DEBUG_PORTS Debug.WriteLine("Connector: OPENED:"); Debug.WriteLine("Connector: start of call stack"); StackTrace trace = new StackTrace(); foreach (StackFrame frame in trace.GetFrames()) { MethodBase meth = frame.GetMethod(); Debug.WriteLine(meth.DeclaringType.FullName + "." + meth.Name); } Debug.WriteLine("Connector: end of call stack"); #endif } Initialize(); openCashDrawerEnabled = (bool)parameters [ConnectParameters.OpenDrawer]; } catch (IOException ioex) { throw new HardwareErrorException(new ErrorState(ErrorState.BadSerialPort, HardwareErrorSeverity.Error), ioex); } catch (UnauthorizedAccessException uaex) { throw new HardwareErrorException(new ErrorState(ErrorState.BadSerialPort, HardwareErrorSeverity.Error), uaex); } } catch (Exception) { Disconnect(); throw; } base.Connect(parameters); }
protected void SetPassword(ConnectParametersCollection parameters) { operatorPassword = (string)parameters [ConnectParameters.Password]; }
public virtual void Connect(ConnectParametersCollection parameters) { }
protected void SetEncoding(ConnectParametersCollection parameters) { SetEncoding((int)parameters [ConnectParameters.Encoding]); }
public override void Connect(ConnectParametersCollection parameters) { printTotalOnly = (bool)parameters [ConnectParameters.PrintTotalOnly]; base.Connect(parameters); }
public void SetNetworkPort(ConnectParametersCollection parameters) { NetworkPort = (int)parameters [ConnectParameters.NetworkPort]; }
public void SetNetworkAddress(ConnectParametersCollection parameters) { NetworkAddress = (string)parameters [ConnectParameters.NetworkAddress]; }
public void SetBaudRate(ConnectParametersCollection parameters) { BaudRate = (int)parameters [ConnectParameters.BaudRate]; }
public void SetPortName(ConnectParametersCollection parameters) { PortName = (string)parameters [ConnectParameters.SerialPortName]; }