public static OperatingSystemFamilyType FromValue(int value) { foreach (OperatingSystemFamilyType systemFamilyType in OperatingSystemFamilyType.Values()) { if (systemFamilyType.Value().Equals(value)) { return(systemFamilyType); } } throw new ArgumentException(value.ToString()); }
public static List <OperatingSystemFamilyType> Values() { OperatingSystemFamilyType systemFamilyType = new OperatingSystemFamilyType(); List <OperatingSystemFamilyType> systemFamilyTypeList = new List <OperatingSystemFamilyType>(); foreach (FieldInfo field in systemFamilyType.GetType().GetFields()) { systemFamilyTypeList.Add((OperatingSystemFamilyType)field.GetValue((object)systemFamilyType)); } return(systemFamilyTypeList); }