public static List <string> GetStatusDisplayName(this DeviceStatusType status) { List <string> result = new List <string>(); foreach (Constants.Device.DeviceStatusInfo info in Constants.Device.statusInfos) { if (status.HasFlag(info.StatusType)) { result.Add(info.DisplayName); } } return(result); }
public static DeviceSeverityType GetStatusSeverity(DeviceStatusType status) { DeviceSeverityType severity = DeviceSeverityType.OK; foreach (DeviceStatusInfo deviceStatusInfo in statusInfos) { if (status.HasFlag(deviceStatusInfo.StatusType) && deviceStatusInfo.Severity > severity) { severity = deviceStatusInfo.Severity; } } return(severity); }