public bool TestConnection() { try { // Log(string.Format("test printer availability")); FP2000KL = null; FP2000KL = new CS_BGR_FP2000_KLClass(); Connect(comPort, comSpeed); return true; }catch(Exception) { return false; } }
public void ConnectFiscalPrinter() { try { FP2000KL = null; FP2000KL = new CS_BGR_FP2000_KLClass(); Connect(comPort, comSpeed); Log(string.Format("Printer connected")); IsConnected = true; FiscalPrinterHelper._isConnected = true; } catch (ArgumentException ex) { MessageBox.Show(ex.Message); } catch (FormatException ex) { MessageBox.Show(ex.Message); } catch (OverflowException ex) { MessageBox.Show(ex.Message); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void Dispose() { if (this.FP2000KL != null) this.FP2000KL = null; }