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