コード例 #1
0
 public static LdapConnectorType FromValue(string value)
 {
     foreach (LdapConnectorType ldapConnectorType in LdapConnectorType.Values())
     {
         if (ldapConnectorType.Value().Equals(value))
         {
             return(ldapConnectorType);
         }
     }
     throw new ArgumentException(value.ToString());
 }
コード例 #2
0
        public static List <LdapConnectorType> Values()
        {
            LdapConnectorType        ldapConnectorType     = new LdapConnectorType();
            List <LdapConnectorType> ldapConnectorTypeList = new List <LdapConnectorType>();

            foreach (FieldInfo field in ldapConnectorType.GetType().GetFields())
            {
                ldapConnectorTypeList.Add((LdapConnectorType)field.GetValue((object)ldapConnectorType));
            }
            return(ldapConnectorTypeList);
        }