public static LdapModeType FromValue(string value) { foreach (LdapModeType ldapModeType in LdapModeType.Values()) { if (ldapModeType.Value().Equals(value)) { return(ldapModeType); } } throw new ArgumentException(value.ToString()); }
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); }