Ejemplo n.º 1
0
        public static ResolvedMethodSpec CreateFromMultipleParts(IUnresolvedMethod[] parts, ITypeResolveContext[] contexts, bool isExtensionMethod)
        {
            ResolvedMethodSpec method = new ResolvedMethodSpec(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);
        }
Ejemplo 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(MethodCore.DummyConstructor))
             {
                 return(new[] { ResolvedMethodSpec.GetDummyConstructor(compilation, this) });
             }
         }
         return(EmptyList <IMethod> .Instance);
     }
     else
     {
         return(GetMembersHelper.GetConstructors(this, filter, options));
     }
 }