Beispiel #1
0
 private static void DeviceWatcher_DeviceQueryRemove(object sender, DeviceNotificationEventArgs e)
 {
     if (DirectoryWatchers.ContainsKey(e.Name))
     {
         DirectoryWatchers[e.Name].Stop();
     }
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnDeviceAdded(object sender, DeviceNotificationEventArgs e)
 {
     if (e.TryGetDevice(out var device))
     {
         OnDeviceAdded(device);
     }
 }
Beispiel #3
0
 private void OnDeviceRemoved(object sender, DeviceNotificationEventArgs e)
 {
     e.TryGetDevice(out var device);
     if (device.DeviceID.GetHashCode() == Device.DeviceID.GetHashCode())
     {
         DeviceRemoved?.Invoke(this);
     }
 }
Beispiel #4
0
 private static void OnDeviceAdded(object sender, DeviceNotificationEventArgs e)
 {
     using (var enumerator = new MMDeviceEnumerator())
         using (var mmDevice = enumerator.GetDevice(e.DeviceId))
         {
             Console.WriteLine($"{mmDevice.FriendlyName} added");
         }
 }
Beispiel #5
0
        private void OnDeviceRemoved(object sender, DeviceNotificationEventArgs e)
        {
            if (e.DeviceId != DeviceId)
            {
                return;
            }

            DeviceRemoved?.Invoke(this);
        }
Beispiel #6
0
 private void iBootleft(object sender, DeviceNotificationEventArgs args)
 {
     if (iLeft == true)
     {
         return;
     }
     try {
         //iBoot disconnected.
         MDIMain.Activate();
         this.Invoke((MethodInvoker)Cleanup);
     } catch (Exception ex) {
     }
 }
Beispiel #7
0
        private static void DeviceWatcher_DeviceArrived(object sender, DeviceNotificationEventArgs e)
        {
            if (DirectoryWatchers.ContainsKey(e.Name))
            {
                DirectoryWatchers[e.Name].Start();
            }
            else
            {
                RegisterDirectoryWatcher(e.Name);
            }

            SendNotificationMessage(NotificationType.Add, e.Name);
        }
Beispiel #8
0
 private void SetDeviceModeUI(object sender, DeviceNotificationEventArgs e)
 {
     SetDeviceMode(e.Message);
 }
Beispiel #9
0
 private void UnloadDeviceConfigurationDomainUI(object sender, DeviceNotificationEventArgs e)
 {
     UnloadDeviceConfigurationDomain(e.Message);
 }
 private void DeviceAdded(object sender, DeviceNotificationEventArgs args)
 {
 }
Beispiel #11
0
 private void MmNotificationClient_DeviceRemoved(object sender, DeviceNotificationEventArgs e)
 {
     this.audioDevicesChangedTimer.Stop();
     this.audioDevicesChangedTimer.Start();
 }
Beispiel #12
0
 protected void OnDfuDisconnect(DeviceNotificationEventArgs args)
 {
     DeviceNotificationEventHandler dfuDisconnect = DfuDisconnect;
     if (dfuDisconnect != null)
     {
         dfuDisconnect(this, args);
     }
 }
Beispiel #13
0
 private void SetEmvButtonUI(object sender, DeviceNotificationEventArgs e)
 {
     SetEmvButton(e.Message);
 }
Beispiel #14
0
 private void ShowConfigGroupUI(object sender, DeviceNotificationEventArgs e)
 {
     ShowConfigGroup(e.Message);
 }
Beispiel #15
0
 /// <summary>
 /// Get new default device
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MMN_DeviceRemoved(object sender, DeviceNotificationEventArgs e) => GetMMD();
Beispiel #16
0
 private void DeviceNotification_DeviceRemoved(object sender, DeviceNotificationEventArgs e)
 {
     _defaultDeviceChanged = true;
 }
Beispiel #17
0
 private void _mmNotificationClient_DeviceAdded(object sender, DeviceNotificationEventArgs e)
 {
     Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                                                new Action(() => AddDevice(e.DeviceId)));
 }
Beispiel #18
0
 protected void OnRecoveryModeLeave(DeviceNotificationEventArgs args)
 {
     DeviceNotificationEventHandler recoveryModeLeave = RecoveryModeLeave;
     if (recoveryModeLeave != null)
     {
         recoveryModeLeave(this, args);
     }
 }
Beispiel #19
0
 protected void OnRecoveryModeEnter(DeviceNotificationEventArgs args)
 {
     DeviceNotificationEventHandler recoveryModeEnter = RecoveryModeEnter;
     if (recoveryModeEnter != null)
     {
         recoveryModeEnter(this, args);
     }
 }
Beispiel #20
0
 private void ShowTerminalDataUI(object sender, DeviceNotificationEventArgs e)
 {
     ShowTerminalData(e.Message);
 }
Beispiel #21
0
 private void ShowCapKListUI(object sender, DeviceNotificationEventArgs e)
 {
     ShowCapKList(e.Message);
 }
Beispiel #22
0
 private void FirmwareUpdateFailedUI(object sender, DeviceNotificationEventArgs e)
 {
     FirmwareUpdateFailed(e.Message);
 }
Beispiel #23
0
 private void EnableButtonsUI(object sender, DeviceNotificationEventArgs e)
 {
     EnableButtons();
 }
Beispiel #24
0
        /********************************************************************************************************/
        // DELEGATES SECTION
        /********************************************************************************************************/
        #region -- delegates section --

        private void InitalizeDeviceUI(object sender, DeviceNotificationEventArgs e)
        {
            InitalizeDevice();
        }
Beispiel #25
0
 private void FirmwareUpdateStatusUI(object sender, DeviceNotificationEventArgs e)
 {
     FirmwareUpdateStatus(e.Message);
 }
Beispiel #26
0
 private static void DeviceWatcher_DeviceRemoveComplete(object sender, DeviceNotificationEventArgs e)
 {
     SendNotificationMessage(NotificationType.Remove, e.Name);
 }
Beispiel #27
0
 private void EnableMainFormUI(object sender, DeviceNotificationEventArgs e)
 {
     EnableMainForm(e.Message);
 }
Beispiel #28
0
 public void NotificationRaise(DeviceNotificationEventArgs e)
 {
     OnDeviceNotification?.Invoke(null, e);
 }
Beispiel #29
0
        protected void OnDeviceNotificationUI(object sender, DeviceNotificationEventArgs args)
        {
            Debug.WriteLine("main: notification type={0}", args.NotificationType);

            switch (args.NotificationType)
            {
            case NOTIFICATION_TYPE.NT_INITIALIZE_DEVICE:
            {
                break;
            }

            case NOTIFICATION_TYPE.NT_DEVICE_UPDATE_CONFIG:
            {
                UpdateUI();
                break;
            }

            case NOTIFICATION_TYPE.NT_UNLOAD_DEVICE_CONFIGDOMAIN:
            {
                UnloadDeviceConfigurationDomainUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_SET_DEVICE_MODE:
            {
                SetDeviceModeUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_SHOW_TERMINAL_DATA:
            {
                ShowTerminalDataUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_SHOW_AID_LIST:
            {
                ShowAidListUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_SHOW_CAPK_LIST:
            {
                ShowCapKListUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_SHOW_CONFIG_GROUP:
            {
                ShowConfigGroupUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_UI_ENABLE_BUTTONS:
            {
                EnableButtonsUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_SET_EMV_MODE_BUTTON:
            {
                SetEmvButtonUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_FIRMWARE_UPDATE_STEP:
            {
                FirmwareUpdateProgressUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_FIRMWARE_UPDATE_STATUS:
            {
                FirmwareUpdateStatusUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_FIRMWARE_UPDATE_FAILED:
            {
                FirmwareUpdateFailedUI(sender, args);
                break;
            }

            case NOTIFICATION_TYPE.NT_FIRMWARE_UPDATE_COMPLETE:
            {
                EnableMainFormUI(sender, args);
                break;
            }
            }
        }
Beispiel #30
0
 private void MMNotificationClient_DeviceRemoved(object sender, DeviceNotificationEventArgs e)
 {
     Application.Current.Dispatcher.BeginInvoke(new Action(() => RemoveDevice(e.DeviceId)));
 }