internal ConversionOperatorWithReflection(ITypeWithReflection declaringType, MethodInfo method)
 {
     this.declaringType = declaringType;
     this.method        = method;
     attributes         = new Lazy <Attributes>(() => new Attributes(method));
     parameter          = new OperatorParameterWithReflection(new ParameterWithReflection(method.GetParameters()[0], method));
     returnType         = TypeReferenceWithReflectionFactory.CreateReference(method.ReturnType, method);
     returnAttributes   = new Lazy <Attributes>(() => new Attributes(method.ReturnParameter));
     body = new Lazy <ILMethodBodyWithReflectionEmit>(() => new ILMethodBodyWithReflectionEmit(method));
 }
Beispiel #2
0
 internal OperatorOverloadWithReflection(ITypeWithReflection declaringType, MethodInfo method)
 {
     this.declaringType = declaringType;
     this.method        = method;
     attributes         = new Lazy <Attributes>(() => new Attributes(method));
     returnType         = TypeReferenceWithReflectionFactory.CreateReference(method.ReturnType, method);
     parameters         = new Lazy <Parameters <OperatorParameterWithReflection> >(
         () => new Parameters <OperatorParameterWithReflection>(method, parameter => new OperatorParameterWithReflection(parameter)));
     body = new Lazy <ILMethodBodyWithReflectionEmit>(() => new ILMethodBodyWithReflectionEmit(method));
 }
Beispiel #3
0
 internal InterfaceMethodWithReflection(IBasicTypeWithReflection declaringType, MethodInfo method)
 {
     this.method        = method;
     this.declaringType = declaringType;
     attributes         = new Lazy <Attributes>(() => new Attributes(method));
     returnAttributes   = new Lazy <Attributes>(() => new Attributes(method.ReturnParameter));
     genericParameters  = new Lazy <GenericParameterDeclarations>(() => new GenericParameterDeclarations(method));
     returnType         = TypeReferenceWithReflectionFactory.CreateReference(method.ReturnType, method);
     parameters         = new Lazy <Parameters <MethodParameterWithReflection> >(
         () => new Parameters <MethodParameterWithReflection>(method, parameter => new MethodParameterWithReflection(parameter)));
 }
Beispiel #4
0
        internal DelegateWithReflection(AssemblyWithReflection assembly, NamespaceWithReflection @namespace, Type type)
        {
            this.assembly     = assembly;
            this.@namespace   = @namespace;
            this.type         = type;
            attributes        = new Lazy <Attributes>(() => new Attributes(type));
            genericParameters = new Lazy <GenericParameterDeclarations>(() => new GenericParameterDeclarations(type));
            MethodInfo method = type.GetMethod("Invoke");

            returnType = TypeReferenceWithReflectionFactory.CreateReference(method.ReturnType, method);
            parameters = new Lazy <Parameters <DelegateParameterWithReflection> >(
                () => new Parameters <DelegateParameterWithReflection>(method, parameter => new DelegateParameterWithReflection(parameter)));
        }
        internal InterfacePropertyWithReflection(IBasicTypeWithReflection declaringType, PropertyInfo property)
        {
            this.property      = property;
            this.declaringType = declaringType;
            attributes         = new Lazy <Attributes>(() => new Attributes(property));
            propertyType       = TypeReferenceWithReflectionFactory.CreateReference(property.PropertyType, property);
            if (property.GetMethod != null)
            {
                getAccessor = new InterfaceAccessorWithReflection(property.GetMethod);
            }

            if (property.SetMethod != null)
            {
                setAccessor = new InterfaceAccessorWithReflection(property.SetMethod);
            }
        }
        internal InterfaceIndexerWithReflection(IBasicTypeWithReflection declaringType, PropertyInfo indexer)
        {
            this.indexer       = indexer;
            this.declaringType = declaringType;
            attributes         = new Lazy <Attributes>(() => new Attributes(indexer));
            indexerType        = TypeReferenceWithReflectionFactory.CreateReference(indexer.PropertyType, indexer);
            parameters         = new Lazy <Parameters <IndexerParameterWithReflection> >(
                () => new Parameters <IndexerParameterWithReflection>(indexer, parameter => new IndexerParameterWithReflection(parameter)));
            if (indexer.GetMethod != null)
            {
                getAccessor = new InterfaceAccessorWithReflection(indexer.GetMethod);
            }

            if (indexer.SetMethod != null)
            {
                setAccessor = new InterfaceAccessorWithReflection(indexer.SetMethod);
            }
        }
Beispiel #7
0
 internal ArrayTypeReferenceWithReflection(Type type, MemberInfo member)
 {
     this.type   = type;
     dimensions  = type.GetArrayRank();
     elementType = TypeReferenceWithReflectionFactory.CreateReference(type.GetElementType(), member);
 }
Beispiel #8
0
 internal NestedTypeReferenceWithReflection(Type nestedType)
 {
     type            = TypeReferenceWithReflectionFactory.CreateReference(nestedType.DeclaringType);
     this.nestedType = TypeReferenceWithReflectionFactory.CreateReference(nestedType, ignoreNestedType: true);
 }
 internal ParameterWithReflection(ParameterInfo parameter, MemberInfo member)
 {
     this.parameter = parameter;
     attributes     = new Lazy <Attributes>(() => new Attributes(parameter, excludedAttributeTypes));
     parameterType  = TypeReferenceWithReflectionFactory.CreateReference(parameter.ParameterType, member);
 }