Esempio n. 1
0
        public static DefaultResolvedMethod CreateFromMultipleParts(IUnresolvedMethod[] parts, ITypeResolveContext[] contexts, bool isExtensionMethod)
        {
            DefaultResolvedMethod method = new DefaultResolvedMethod(parts[0], contexts[0], isExtensionMethod);

            method.parts = parts;
            if (parts.Length > 1)
            {
                var attrs = new ListOfLists <IAttribute>();
                attrs.AddList(method.Attributes);
                for (int i = 1; i < parts.Length; i++)
                {
                    attrs.AddList(parts[i].Attributes.CreateResolvedAttributes(contexts[i]));
                }
                method.Attributes = attrs;
            }
            return(method);
        }
Esempio n. 2
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(DefaultUnresolvedMethod.DummyConstructor))
             {
                 return(new[] { DefaultResolvedMethod.GetDummyConstructor(compilation, this) });
             }
         }
         return(EmptyList <IMethod> .Instance);
     }
     else
     {
         return(GetMembersHelper.GetConstructors(this, filter, options));
     }
 }