示例#1
0
 public static IpAddressAllocationModeType FromValue(string value)
 {
     foreach (IpAddressAllocationModeType allocationModeType in IpAddressAllocationModeType.Values())
     {
         if (allocationModeType.Value().Equals(value))
         {
             return(allocationModeType);
         }
     }
     throw new ArgumentException(value.ToString());
 }
示例#2
0
        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);
        }