Пример #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);
     }
 }
Пример #3
0
 private void OnDeviceRemoved(object sender, DeviceNotificationEventArgs e)
 {
     e.TryGetDevice(out var device);
     if (device.DeviceID.GetHashCode() == Device.DeviceID.GetHashCode())
     {
         DeviceRemoved?.Invoke(this);
     }
 }
Пример #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");
         }
 }
Пример #5
0
        private void OnDeviceRemoved(object sender, DeviceNotificationEventArgs e)
        {
            if (e.DeviceId != DeviceId)
            {
                return;
            }

            DeviceRemoved?.Invoke(this);
        }
Пример #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) {
     }
 }
Пример #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);
        }
Пример #8
0
 private void SetDeviceModeUI(object sender, DeviceNotificationEventArgs e)
 {
     SetDeviceMode(e.Message);
 }
Пример #9
0
 private void UnloadDeviceConfigurationDomainUI(object sender, DeviceNotificationEventArgs e)
 {
     UnloadDeviceConfigurationDomain(e.Message);
 }
Пример #10
0
 private void DeviceAdded(object sender, DeviceNotificationEventArgs args)
 {
 }
Пример #11
0
 private void MmNotificationClient_DeviceRemoved(object sender, DeviceNotificationEventArgs e)
 {
     this.audioDevicesChangedTimer.Stop();
     this.audioDevicesChangedTimer.Start();
 }
Пример #12
0
 protected void OnDfuDisconnect(DeviceNotificationEventArgs args)
 {
     DeviceNotificationEventHandler dfuDisconnect = DfuDisconnect;
     if (dfuDisconnect != null)
     {
         dfuDisconnect(this, args);
     }
 }
Пример #13
0
 private void SetEmvButtonUI(object sender, DeviceNotificationEventArgs e)
 {
     SetEmvButton(e.Message);
 }
Пример #14
0
 private void ShowConfigGroupUI(object sender, DeviceNotificationEventArgs e)
 {
     ShowConfigGroup(e.Message);
 }
Пример #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();
Пример #16
0
 private void DeviceNotification_DeviceRemoved(object sender, DeviceNotificationEventArgs e)
 {
     _defaultDeviceChanged = true;
 }
Пример #17
0
 private void _mmNotificationClient_DeviceAdded(object sender, DeviceNotificationEventArgs e)
 {
     Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
                                                new Action(() => AddDevice(e.DeviceId)));
 }
Пример #18
0
 protected void OnRecoveryModeLeave(DeviceNotificationEventArgs args)
 {
     DeviceNotificationEventHandler recoveryModeLeave = RecoveryModeLeave;
     if (recoveryModeLeave != null)
     {
         recoveryModeLeave(this, args);
     }
 }
Пример #19
0
 protected void OnRecoveryModeEnter(DeviceNotificationEventArgs args)
 {
     DeviceNotificationEventHandler recoveryModeEnter = RecoveryModeEnter;
     if (recoveryModeEnter != null)
     {
         recoveryModeEnter(this, args);
     }
 }
Пример #20
0
 private void ShowTerminalDataUI(object sender, DeviceNotificationEventArgs e)
 {
     ShowTerminalData(e.Message);
 }
Пример #21
0
 private void ShowCapKListUI(object sender, DeviceNotificationEventArgs e)
 {
     ShowCapKList(e.Message);
 }
Пример #22
0
 private void FirmwareUpdateFailedUI(object sender, DeviceNotificationEventArgs e)
 {
     FirmwareUpdateFailed(e.Message);
 }
Пример #23
0
 private void EnableButtonsUI(object sender, DeviceNotificationEventArgs e)
 {
     EnableButtons();
 }
Пример #24
0
        /********************************************************************************************************/
        // DELEGATES SECTION
        /********************************************************************************************************/
        #region -- delegates section --

        private void InitalizeDeviceUI(object sender, DeviceNotificationEventArgs e)
        {
            InitalizeDevice();
        }
Пример #25
0
 private void FirmwareUpdateStatusUI(object sender, DeviceNotificationEventArgs e)
 {
     FirmwareUpdateStatus(e.Message);
 }
Пример #26
0
 private static void DeviceWatcher_DeviceRemoveComplete(object sender, DeviceNotificationEventArgs e)
 {
     SendNotificationMessage(NotificationType.Remove, e.Name);
 }
Пример #27
0
 private void EnableMainFormUI(object sender, DeviceNotificationEventArgs e)
 {
     EnableMainForm(e.Message);
 }
Пример #28
0
 public void NotificationRaise(DeviceNotificationEventArgs e)
 {
     OnDeviceNotification?.Invoke(null, e);
 }
Пример #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;
            }
            }
        }
Пример #30
0
 private void MMNotificationClient_DeviceRemoved(object sender, DeviceNotificationEventArgs e)
 {
     Application.Current.Dispatcher.BeginInvoke(new Action(() => RemoveDevice(e.DeviceId)));
 }