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