diff options
| author | a1xd <[email protected]> | 2021-09-24 02:04:43 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-24 02:04:43 -0400 |
| commit | 2896b8a09ce42e965705c58593b8738adc454f7f (patch) | |
| tree | 71e4d0cff60b5a1ad11427d78e1f8c7b775e5690 /grapher/Models/Devices/DeviceIDManager.cs | |
| parent | Merge pull request #107 from a1xd/1.5.0-fix (diff) | |
| parent | make note clearer (diff) | |
| download | rawaccel-master.tar.xz rawaccel-master.zip | |
v1.6
Diffstat (limited to 'grapher/Models/Devices/DeviceIDManager.cs')
| -rw-r--r-- | grapher/Models/Devices/DeviceIDManager.cs | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/grapher/Models/Devices/DeviceIDManager.cs b/grapher/Models/Devices/DeviceIDManager.cs deleted file mode 100644 index 39856a1..0000000 --- a/grapher/Models/Devices/DeviceIDManager.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Management; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace grapher.Models.Devices -{ - public class DeviceIDManager - { - public DeviceIDManager(ToolStripMenuItem deviceIDs) - { - DeviceIDsMenuItem = deviceIDs; - DeviceIDsMenuItem.Checked = false; - } - - public ToolStripMenuItem DeviceIDsMenuItem { get; } - - public string ID { get => SelectedDeviceID.ID; } - - public DeviceIDItem SelectedDeviceID { get; private set; } - - public Dictionary<string, DeviceIDItem> DeviceIDs { get; private set; } - - public void SetActive(DeviceIDItem deviceIDItem) - { - if (SelectedDeviceID != null) - { - SelectedDeviceID.SetDeactivated(); - } - - SelectedDeviceID = deviceIDItem; - SelectedDeviceID.SetActivated(); - } - - public void Update(string devID) - { - DeviceIDsMenuItem.DropDownItems.Clear(); - - bool found = string.IsNullOrEmpty(devID); - - var anyDevice = new DeviceIDItem("Any", string.Empty, this); - - if (found) SetActive(anyDevice); - - foreach (string id in RawInputInterop.GetDeviceIDs()) - { - var deviceItem = new DeviceIDItem(string.Empty, id, this); - if (!found && deviceItem.ID.Equals(devID)) - { - SetActive(deviceItem); - found = true; - } - } - - if (!found) - { - var deviceItem = new DeviceIDItem(string.Empty, devID, this); - deviceItem.SetDisconnected(); - SetActive(deviceItem); - } - } - - } -} |