コード例 #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));
 }