internal static void GetInputAssemblies(this ConstructorRef constructorRef, ISet <AssemblyName> assemblies)
        {
            Requires.NotNull(assemblies, nameof(assemblies));

            if (!constructorRef.IsEmpty)
            {
                constructorRef.DeclaringType.GetInputAssemblies(assemblies);
            }
        }
Exemple #2
0
        public static ConstructorInfo Resolve(this ConstructorRef constructorRef)
        {
            if (constructorRef.IsEmpty)
            {
                return(null);
            }

            var manifest = constructorRef.Resolver.GetManifest(constructorRef.DeclaringType.AssemblyName);

            return((ConstructorInfo)manifest.ResolveMethod(constructorRef.MetadataToken));
        }
Exemple #3
0
        public static ConstructorInfo Resolve(this ConstructorRef constructorRef)
        {
            if (constructorRef.IsEmpty)
            {
                return(null);
            }

#if RuntimeHandles
            var manifest = constructorRef.Resolver.GetManifest(constructorRef.DeclaringType.AssemblyName);
            return((ConstructorInfo)manifest.ResolveMethod(constructorRef.MetadataToken));
#else
            return(FindMethodByParameters(
                       Resolve(constructorRef.DeclaringType).GetConstructors(AllInstanceMembers),
                       ConstructorInfo.ConstructorName,
                       constructorRef.ParameterTypes));
#endif
        }
        public static ConstructorInfo Resolve(this ConstructorRef constructorRef)
        {
            if (constructorRef.IsEmpty)
            {
                return(null);
            }

#if RuntimeHandles
            if (TryUseFastReflection(constructorRef.DeclaringType, out Module manifest))
            {
                return((ConstructorInfo)manifest.ResolveMethod(constructorRef.MetadataToken));
            }
            else
#endif
            {
                return(FindMethodByParameters(
                           Resolve(constructorRef.DeclaringType).GetConstructors(AllMembers),
                           ConstructorInfo.ConstructorName,
                           constructorRef.ParameterTypes));
            }
        }
Exemple #5
0
 public MethodRef(ConstructorRef constructor)
     : this(constructor.DeclaringType, constructor.MetadataToken, ConstructorInfo.ConstructorName, constructor.ParameterTypes, ImmutableArray <TypeRef> .Empty)
 {
     this.methodBase = constructor.ConstructorInfoNoResolve;
 }
Exemple #6
0
 public MemberRef(ConstructorRef constructor)
     : this()
 {
     this.Constructor = constructor;
 }
 public ConstructorDesc(ConstructorRef constructor, string name, bool isStatic)
     : base(name, isStatic)
 {
     this.Constructor = constructor;
 }
Exemple #8
0
 public ParameterRef(ConstructorRef ctor, int parameterIndex)
     : this()
 {
     this.Constructor    = ctor;
     this.parameterIndex = parameterIndex;
 }
 public ParameterRef(ConstructorRef ctor, int parameterIndex)
     : this(ctor.DeclaringType, ctor.MetadataToken, parameterIndex)
 {
 }