Exemplo n.º 1
0
 private void CloseDevices()
 {
     try
     {
         if (this.m_ApplicationType.ToUpper() == "TOUCHPARK")
         {
             if (Devices.CardDevice != null)
             {
                 Devices.CardDevice.CloseConnection();
             }
             if (Devices.CoinMechanism == null)
             {
                 return;
             }
             Devices.CoinMechanism = (CoinMechanism)null;
         }
         else
         {
             Devices.CoinMechanism = (CoinMechanism) new SimulatedCoinMechanism();
         }
     }
     catch (CashDeviceCouldNotBeFoundException ex)
     {
         Log.Write((Exception)ex);
         OutOfOrderForm outOfOrderForm = new OutOfOrderForm();
         outOfOrderForm.Refresh();
         Application.DoEvents();
         int num = (int)outOfOrderForm.ShowDialog();
     }
 }
Exemplo n.º 2
0
 private void OpenDevices()
 {
     try
     {
         if (this.m_ApplicationType.ToUpper() == "TOUCHPARK")
         {
             this.UseWaitCursor = true;
             string text = this.messageButton.Text;
             this.messageButton.Text = "Initialising Payment Devices, Please Wait...";
             this.Refresh();
             Application.DoEvents();
             Devices.CoinMechanism = !Settings.Default.CoinMachineIsSimulated ? new CoinMechanism() : (CoinMechanism) new SimulatedCoinMechanism();
             if (Settings.Default.CardDeviceEnabled)
             {
                 Devices.CardDevice = new CardDevice();
                 Devices.CardDevice.DisplayWelcomeScreenMessage(Settings.Default.CardDeviceWelcomeMessage);
             }
             this.messageButton.Text = text;
             this.Refresh();
             Application.DoEvents();
             this.UseWaitCursor = false;
         }
         else
         {
             Devices.CoinMechanism = (CoinMechanism) new SimulatedCoinMechanism();
         }
     }
     catch (CashDeviceCouldNotBeFoundException ex)
     {
         Log.Write((Exception)ex);
         OutOfOrderForm outOfOrderForm = new OutOfOrderForm();
         outOfOrderForm.Refresh();
         Application.DoEvents();
         int num = (int)outOfOrderForm.ShowDialog();
     }
 }