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

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

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