예제 #1
0
 public static LdapModeType FromValue(string value)
 {
     foreach (LdapModeType ldapModeType in LdapModeType.Values())
     {
         if (ldapModeType.Value().Equals(value))
         {
             return(ldapModeType);
         }
     }
     throw new ArgumentException(value.ToString());
 }
예제 #2
0
        public static List <LdapModeType> Values()
        {
            LdapModeType        ldapModeType     = new LdapModeType();
            List <LdapModeType> ldapModeTypeList = new List <LdapModeType>();

            foreach (FieldInfo field in ldapModeType.GetType().GetFields())
            {
                ldapModeTypeList.Add((LdapModeType)field.GetValue((object)ldapModeType));
            }
            return(ldapModeTypeList);
        }