예제 #1
0
        public IEnumerable <IType> GetNestedTypes(Predicate <ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
        {
            const GetMemberOptions opt = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;

            if ((options & opt) == opt)
            {
                return(GetFiltered(this.NestedTypes, filter));
            }
            else
            {
                return(GetMembersHelper.GetNestedTypes(this, filter, options));
            }
        }
예제 #2
0
 public IEnumerable <IMethod> GetAccessors(Predicate <IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     if (Kind == TypeKind.Void)
     {
         return(EmptyList <IMethod> .Instance);
     }
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         return(GetFilteredAccessors(filter));
     }
     else
     {
         return(GetMembersHelper.GetAccessors(this, filter, options));
     }
 }
예제 #3
0
 public IEnumerable <IProperty> GetProperties(Predicate <IProperty> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     if (Kind == TypeKind.Void)
     {
         return(EmptyList <IProperty> .Instance);
     }
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         return(GetFiltered(this.Properties, filter));
     }
     else
     {
         return(GetMembersHelper.GetProperties(this, filter, options));
     }
 }
예제 #4
0
 public IEnumerable <IMethod> GetMethods(Predicate <IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     if (Kind == TypeKind.Void)
     {
         return(EmptyList <IMethod> .Instance);
     }
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         return(GetFiltered(this.Methods, ExtensionMethods.And(m => !m.IsConstructor, filter)));
     }
     else
     {
         return(GetMembersHelper.GetMethods(this, filter, options));
     }
 }
예제 #5
0
 public IEnumerable <IMethod> GetConstructors(Predicate <IMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)
 {
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         if (this.HasDefaultConstructorConstraint || this.HasValueTypeConstraint)
         {
             var dummyCtor = FakeMethod.CreateDummyConstructor(compilation, this);
             if (filter == null || filter(dummyCtor))
             {
                 return(new [] { dummyCtor });
             }
         }
         return(EmptyList <IMethod> .Instance);
     }
     else
     {
         return(GetMembersHelper.GetConstructors(this, filter, options));
     }
 }
예제 #6
0
 public IEnumerable <IType> GetNestedTypes(IReadOnlyList <IType> typeArguments, Predicate <ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     return(GetMembersHelper.GetNestedTypes(this, typeArguments, filter, options));
 }