diff options
| author | a1xd <[email protected]> | 2021-09-15 06:41:57 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2021-09-23 22:34:51 -0400 |
| commit | 7c0305ae2c99c191baf61eb920025826057d5753 (patch) | |
| tree | 6a394d4ac8d69436f7bd8f1255f1d4fd3439280c /grapher/Models/Devices/DeviceIDManager.cs | |
| parent | fix potential leaks (diff) | |
| download | rawaccel-7c0305ae2c99c191baf61eb920025826057d5753.tar.xz rawaccel-7c0305ae2c99c191baf61eb920025826057d5753.zip | |
add device menu
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 e0ee686..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); - } - } - - } -} |