private void UnhideDeviceBtn_Click(object sender, EventArgs e) { if (HiddenDevicesListBox.SelectedIndex != -1) { string hid = HiddenDevicesListBox.SelectedItem.ToString().Split(':')[1]; HIDGuardianAPI.UnhideDevice(hid); MoveSelectedListBoxItem(HiddenDevicesListBox, AvailableDevicesListBox); HIDGuardianAPI.ReplugHID(hid); } }
private void UnhideDevices() { string prevaffecteddevices = HIDGuardianAPI.GetAffectedDevicesList(); // Get a list of available hidden devices from last run. foreach (string prevaffecteddevice in prevaffecteddevices.Split(';')) { HIDGuardianAPI.UnhideDevice(prevaffecteddevice); HIDGuardianAPI.ReplugHID(prevaffecteddevice); // Iterate over the list of affected devices from the last run and replug them (to refresh them). } }
private void UnhideAllBtn_Click(object sender, EventArgs e) { HIDGuardianAPI.UnhideAllDevices(); foreach (var device in HiddenDevicesListBox.Items) { string hid = device.ToString().Split(':')[1]; HIDGuardianAPI.UnhideDevice(hid); HIDGuardianAPI.ReplugHID(hid); } MoveListBoxItems(HiddenDevicesListBox, AvailableDevicesListBox); }