예제 #1
0
 public virtual IEnumerable <IMethod> GetMethods(Predicate <IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         return(GetFilteredMethods(Utils.ExtensionMethods.And(m => !m.IsConstructor, filter)));
     }
     else
     {
         return(GetMembersHelper.GetMethods(this, filter, options));
     }
 }
예제 #2
0
 public virtual IEnumerable <IMethod> GetAccessors(Predicate <IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         return(GetFilteredAccessors(filter));
     }
     else
     {
         return(GetMembersHelper.GetAccessors(this, filter, options));
     }
 }
예제 #3
0
 public virtual IEnumerable <IEvent> GetEvents(Predicate <IUnresolvedEvent> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         return(GetFilteredNonMethods <IUnresolvedEvent, IEvent>(filter));
     }
     else
     {
         return(GetMembersHelper.GetEvents(this, filter, options));
     }
 }
예제 #4
0
        public virtual IEnumerable <IEvent> GetEvents(ITypeResolveContext context, Predicate <IEvent> filter = null, GetMemberOptions options = GetMemberOptions.None)
        {
            if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
            {
                ITypeDefinition compound = this.compoundTypeDefinition;
                if (compound != this)
                {
                    return(compound.GetEvents(context, filter, options));
                }

                return(ApplyFilter(this.Events, filter));
            }
            else
            {
                return(GetMembersHelper.GetEvents(this, context, filter, options));
            }
        }
예제 #5
0
        public virtual IEnumerable <IMethod> GetConstructors(ITypeResolveContext context, Predicate <IMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)
        {
            if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
            {
                ITypeDefinition compound = this.compoundTypeDefinition;
                if (compound != this)
                {
                    return(compound.GetConstructors(context, filter, options));
                }

                return(GetConstructorsImpl(filter));
            }
            else
            {
                return(GetMembersHelper.GetConstructors(this, context, filter, options));
            }
        }
예제 #6
0
        public virtual IEnumerable <IMethod> GetMethods(ITypeResolveContext context, Predicate <IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
        {
            if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
            {
                ITypeDefinition compound = this.compoundTypeDefinition;
                if (compound != this)
                {
                    return(compound.GetMethods(context, filter, options));
                }

                return(ApplyFilter(this.Methods, Utils.ExtensionMethods.And(m => !m.IsConstructor, filter)));
            }
            else
            {
                return(GetMembersHelper.GetMethods(this, context, filter, options));
            }
        }
 public IEnumerable <IMethod> GetConstructors(Predicate <IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)
 {
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         if (this.HasDefaultConstructorConstraint || this.HasValueTypeConstraint)
         {
             if (filter == null || filter(DefaultUnresolvedMethod.DummyConstructor))
             {
                 return(new [] { DefaultResolvedMethod.GetDummyConstructor(compilation, this) });
             }
         }
         return(EmptyList <IMethod> .Instance);
     }
     else
     {
         return(GetMembersHelper.GetConstructors(this, filter, options));
     }
 }
예제 #8
0
        public IEnumerable <IType> GetNestedTypes(ITypeResolveContext context, Predicate <ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
        {
            const GetMemberOptions opt = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;

            if ((options & opt) == opt)
            {
                ITypeDefinition compound = this.compoundTypeDefinition;
                if (compound != this)
                {
                    return(compound.GetNestedTypes(context, filter, options));
                }

                return(ApplyFilter(this.NestedTypes, filter));
            }
            else
            {
                return(GetMembersHelper.GetNestedTypes(this, context, filter, options));
            }
        }
예제 #9
0
        public IEnumerable <IType> GetNestedTypes(Predicate <ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
        {
            const GetMemberOptions opt = GetMemberOptions.IgnoreInheritedMembers | GetMemberOptions.ReturnMemberDefinitions;

            if ((options & opt) == opt)
            {
                if (filter == null)
                {
                    return(this.NestedTypes);
                }
                else
                {
                    return(GetNestedTypesImpl(filter));
                }
            }
            else
            {
                return(GetMembersHelper.GetNestedTypes(this, filter, options));
            }
        }
예제 #10
0
 public IEnumerable <IMethod> GetConstructors(ITypeResolveContext context, Predicate <IMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)
 {
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         if (HasDefaultConstructorConstraint || HasValueTypeConstraint)
         {
             DefaultMethod m = DefaultMethod.CreateDefaultConstructor(GetDummyClassForTypeParameter());
             if (filter(m))
             {
                 return new [] { m }
             }
             ;
         }
         return(EmptyList <IMethod> .Instance);
     }
     else
     {
         return(GetMembersHelper.GetConstructors(this, context, filter, options));
     }
 }
예제 #11
0
 public IEnumerable <IMethod> GetConstructors(Predicate <IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)
 {
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         if (this.HasDefaultConstructorConstraint || this.HasValueTypeConstraint)
         {
             if (filter == null || filter(dummyConstructor))
             {
                 var     resolvedCtor = (IMethod)dummyConstructor.CreateResolved(compilation.TypeResolveContext);
                 IMethod m            = new SpecializedMethod(this, resolvedCtor, EmptyList <IType> .Instance);
                 return(new [] { m });
             }
         }
         return(EmptyList <IMethod> .Instance);
     }
     else
     {
         return(GetMembersHelper.GetConstructors(this, filter, options));
     }
 }
예제 #12
0
 public IEnumerable <IMethod> GetConstructors(Predicate <IUnresolvedMethod> filter = null, GetMemberOptions options = GetMemberOptions.IgnoreInheritedMembers)
 {
     if ((options & GetMemberOptions.IgnoreInheritedMembers) == GetMemberOptions.IgnoreInheritedMembers)
     {
         if (this.HasDefaultConstructorConstraint || this.HasValueTypeConstraint)
         {
             if (filter == null || filter(dummyConstructor))
             {
                 var     resolvedCtor = GetDummyConstructor(compilation);
                 IMethod m            = new SpecializedMethod(resolvedCtor, TypeParameterSubstitution.Identity)
                 {
                     DeclaringType = this
                 };
                 return(new [] { m });
             }
         }
         return(EmptyList <IMethod> .Instance);
     }
     else
     {
         return(GetMembersHelper.GetConstructors(this, filter, options));
     }
 }
예제 #13
0
 public virtual IEnumerable <IMember> GetMembers(ITypeResolveContext context, Predicate <IMember> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     return(GetMembersHelper.GetMembers(this, context, filter, options));
 }
예제 #14
0
 public virtual IEnumerable <IMethod> GetMethods(IList <IType> typeArguments, ITypeResolveContext context, Predicate <IMethod> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     return(GetMembersHelper.GetMethods(this, typeArguments, context, filter, options));
 }
예제 #15
0
 public IEnumerable <IType> GetNestedTypes(IList <IType> typeArguments, ITypeResolveContext context, Predicate <ITypeDefinition> filter = null, GetMemberOptions options = GetMemberOptions.None)
 {
     return(GetMembersHelper.GetNestedTypes(this, typeArguments, context, filter, options));
 }