Пример #1
0
 public virtual IEnumerable <IMemberInfo> GetMembers()
 {
     if (SystemType != null)
     {
         if (IsEnum)
         {
             foreach (var item in SystemType.GetFields(BindingFlags.Public | BindingFlags.Static))
             {
                 if (item == null)
                 {
                     continue;
                 }
                 yield return(new SystemFieldMemberInfo(item));
             }
         }
         else
         {
             foreach (var item in SystemType.GetFields(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
             {
                 if (item == null)
                 {
                     continue;
                 }
                 yield return(new SystemFieldMemberInfo(item));
             }
             foreach (var item in SystemType.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
             {
                 yield return(new SystemPropertyMemberInfo(item));
             }
             foreach (var item in SystemType.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
             {
                 if (item.IsSpecialName && (item.Name.StartsWith("set_") || item.Name.StartsWith("get_")))
                 {
                     continue;
                 }
                 yield return(new SystemMethodMemberInfo(item));
             }
         }
     }
 }