From 8273ecf0c22876f0f4e9dfa9eb29b9d491614faa Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 7 Jan 2021 23:11:24 -0800 Subject: Refactor --- grapher/Models/Devices/DeviceList.cs | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 grapher/Models/Devices/DeviceList.cs (limited to 'grapher/Models/Devices/DeviceList.cs') diff --git a/grapher/Models/Devices/DeviceList.cs b/grapher/Models/Devices/DeviceList.cs deleted file mode 100644 index 9f2b81d..0000000 --- a/grapher/Models/Devices/DeviceList.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Management; -using System.Collections.Generic; - -namespace grapher.Models.Devices -{ - class DeviceList - { - public static List> GetDeviceHardwareIDs(string PNPClass = "Mouse") - { - var results = new List>(); - - ManagementObjectSearcher searcher = new ManagementObjectSearcher(new SelectQuery("Win32_PnPEntity")); - - foreach (ManagementObject obj in searcher.Get()) - { - if (obj["PNPClass"] != null && obj["PNPClass"].ToString() == PNPClass && obj["HardwareID"] != null) - { - String[] hwidArray = (String[])(obj["HardwareID"]); - if (hwidArray.Length > 0) - { - String hwid = hwidArray[0].ToString(); - String name = obj["Name"].ToString(); - results.Add(Tuple.Create(name, hwid)); - } - } - } - - return results; - } - - } -} -- cgit v1.2.3