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