コード例 #1
0
 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;
     }
 }
コード例 #2
0
 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);
        
     }
 }
コード例 #3
0
 public void Dispose()
 {
     if (this.FP2000KL != null)
         this.FP2000KL = null;
 }