private static string DeviceCategoryToString(DeviceCategory deviceCategory) { if (Tx.TryGetText($"DeviceManager:Categories.{deviceCategory}", out var text)) { return(text); } return(deviceCategory.ToString()); }
public static Guid GetGuid(this DeviceCategory deviceCategory) { var type = typeof(DeviceCategory); return(type.GetMember(deviceCategory.ToString())[0].GetCustomAttribute <DeviceCategoryGuidAttribute>().Guid); }
public static string GetDisplayName(this DeviceCategory deviceCategory) { var type = typeof(DeviceCategory); return(type.GetMember(deviceCategory.ToString())[0].GetCustomAttribute <DeviceCategoryDisplayNameAttribute>().DisplayName); }
private static string DeviceCategoryToString(DeviceCategory deviceCategory) { switch (deviceCategory) { case DeviceCategory.None: return((string)Application.Current.Resources["Other"]); case DeviceCategory.NetworkAdapter: return((string)Application.Current.Resources["NetworkAdapters"]); case DeviceCategory.SystemDevices: return((string)Application.Current.Resources["SystemDevices"]); case DeviceCategory.HumanInterfaceDevicesHID: return((string)Application.Current.Resources["HumanInterfaceDevices"]); case DeviceCategory.AudioEndpoint: return((string)Application.Current.Resources["AudioInputsAndOutputs"]); case DeviceCategory.HardDiskControllers: return((string)Application.Current.Resources["IdeAtaAtapiControllers"]); case DeviceCategory.SoftwareDevices: return((string)Application.Current.Resources["SoftwareDevices"]); case DeviceCategory.ImagingDevice: return((string)Application.Current.Resources["ImageEditing"]); case DeviceCategory.Multimedia: return((string)Application.Current.Resources["SoundVideoAndGameControllers"]); case DeviceCategory.DiskDrives: return((string)Application.Current.Resources["DiskDrives"]); case DeviceCategory.PrintQueue: return((string)Application.Current.Resources["PrintQueues"]); case DeviceCategory.USBDevice: return((string)Application.Current.Resources["UsbControllers"]); case DeviceCategory.Keyboard: return((string)Application.Current.Resources["Keyboards"]); case DeviceCategory.Processors: return((string)Application.Current.Resources["Processors"]); case DeviceCategory.CDROMDrives: return((string)Application.Current.Resources["DvdCdRomDrives"]); case DeviceCategory.WindowsPortableDevices_WPD: return((string)Application.Current.Resources["PortableDevices"]); case DeviceCategory.WSDPrintDevice: return((string)Application.Current.Resources["WsdPrintDevices"]); case DeviceCategory.SCSIandRAIDControllers: return((string)Application.Current.Resources["StorageControllers"]); case DeviceCategory.Monitor: return((string)Application.Current.Resources["Monitors"]); case DeviceCategory.PortsCOM_LPTports: return((string)Application.Current.Resources["PortsComLpt"]); case DeviceCategory.DisplayAdapters: return((string)Application.Current.Resources["DisplayAdapters"]); case DeviceCategory.Mouse: return((string)Application.Current.Resources["MiceAndOtherPointingDevices"]); case DeviceCategory.Computer: return((string)Application.Current.Resources["Computer"]); case DeviceCategory.Sensors: return((string)Application.Current.Resources["Sensors"]); case DeviceCategory.Printers: return((string)Application.Current.Resources["Printers"]); case DeviceCategory.NetworkService: break; default: return(deviceCategory.GetAttributeOfType <DeviceCategoryDisplayNameAttribute>().DisplayName); } return(deviceCategory.ToString()); }