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); } }
private void OnDeviceRemoved(object sender, DeviceNotificationEventArgs e) { e.TryGetDevice(out var device); if (device.DeviceID.GetHashCode() == Device.DeviceID.GetHashCode()) { DeviceRemoved?.Invoke(this); } }
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"); } }
private void OnDeviceRemoved(object sender, DeviceNotificationEventArgs e) { if (e.DeviceId != DeviceId) { return; } DeviceRemoved?.Invoke(this); }
private void iBootleft(object sender, DeviceNotificationEventArgs args) { if (iLeft == true) { return; } try { //iBoot disconnected. MDIMain.Activate(); this.Invoke((MethodInvoker)Cleanup); } catch (Exception ex) { } }
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); }
private void SetDeviceModeUI(object sender, DeviceNotificationEventArgs e) { SetDeviceMode(e.Message); }
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); } }
private void SetEmvButtonUI(object sender, DeviceNotificationEventArgs e) { SetEmvButton(e.Message); }
private void ShowConfigGroupUI(object sender, DeviceNotificationEventArgs e) { ShowConfigGroup(e.Message); }
/// <summary> /// Get new default device /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MMN_DeviceRemoved(object sender, DeviceNotificationEventArgs e) => GetMMD();
private void DeviceNotification_DeviceRemoved(object sender, DeviceNotificationEventArgs e) { _defaultDeviceChanged = true; }
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); } }
private void ShowTerminalDataUI(object sender, DeviceNotificationEventArgs e) { ShowTerminalData(e.Message); }
private void ShowCapKListUI(object sender, DeviceNotificationEventArgs e) { ShowCapKList(e.Message); }
private void FirmwareUpdateFailedUI(object sender, DeviceNotificationEventArgs e) { FirmwareUpdateFailed(e.Message); }
private void EnableButtonsUI(object sender, DeviceNotificationEventArgs e) { EnableButtons(); }
/********************************************************************************************************/ // DELEGATES SECTION /********************************************************************************************************/ #region -- delegates section -- private void InitalizeDeviceUI(object sender, DeviceNotificationEventArgs e) { InitalizeDevice(); }
private void FirmwareUpdateStatusUI(object sender, DeviceNotificationEventArgs e) { FirmwareUpdateStatus(e.Message); }
private static void DeviceWatcher_DeviceRemoveComplete(object sender, DeviceNotificationEventArgs e) { SendNotificationMessage(NotificationType.Remove, e.Name); }
private void EnableMainFormUI(object sender, DeviceNotificationEventArgs e) { EnableMainForm(e.Message); }
public void NotificationRaise(DeviceNotificationEventArgs e) { OnDeviceNotification?.Invoke(null, e); }
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; } } }
private void MMNotificationClient_DeviceRemoved(object sender, DeviceNotificationEventArgs e) { Application.Current.Dispatcher.BeginInvoke(new Action(() => RemoveDevice(e.DeviceId))); }