/** * Initialize EMVX control with servers * and response timeout */ protected bool ReInitDevice() { if (pdc_ax_control == null) { pdc_ax_control = new DsiPDCX(); pdc_ax_control.ServerIPConfig(server_list, 0); pdc_ax_control.SetResponseTimeout(CONNECT_TIMEOUT); InitPDCX(); } lock (pdcLock) { if (pdc_active) { Console.WriteLine("Reset PDC"); pdc_ax_control.CancelRequest(); pdc_active = false; } } lock (emvLock) { if (emv_active) { try { Console.WriteLine("Reset EMV"); emv_ax_control.CancelRequest(); emv_active = false; } catch (Exception ex) { // I assume this will through if either the ActiveX DLL // was generated against an older OCX that doesn't have // this method or if the DLL has the method but the // OCX does not. OCX v1.22+ should have the method. } } } if (emv_ax_control == null) { emv_ax_control = new DsiEMVX(); } FlaggedReset(); if (rba != null) { rba.SetParent(this.parent); rba.SetVerbose(this.verbose_mode); try { rba.stubStart(); } catch (Exception) {} } return(true); }
/** * Initialize EMVX control with servers * and response timeout */ protected bool ReInitDevice() { if (pdc_ax_control == null) { pdc_ax_control = new DsiPDCX(); pdc_ax_control.ServerIPConfig(server_list, 0); pdc_ax_control.SetResponseTimeout(CONNECT_TIMEOUT); InitPDCX(); } lock (pdcLock) { if (pdc_active) { Console.WriteLine("Reset PDC"); pdc_ax_control.CancelRequest(); pdc_active = false; } } lock (emvLock) { if (emv_active) { Console.WriteLine("Reset EMV"); var type = emv_ax_control.GetType(); if (type.GetMethod("CancelRequest") != null) { emv_ax_control.CancelRequest(); emv_active = false; } } } if (emv_ax_control == null) { emv_ax_control = new DsiEMVX(); } FlaggedReset(); if (rba != null) { rba.SetParent(this.parent); rba.SetVerbose(this.verbose_mode); try { rba.stubStart(); } catch (Exception) {} } return(true); }