示例#1
0
        public Reflector SetIndexer(object target, Type[] paramTypes, object[] parameters)
        {
            CallInfo_ callInfo = CallInfo_.CreateIndexerSetCallInfo(target.GetType(), target, paramTypes, parameters);

            new MethodInvocationEmitter_(callInfo, cache).Execute();
            return(this);
        }
示例#2
0
        public Reflector Invoke(object target, string methodName, Type[] paramTypes, object[] parameters)
        {
            CallInfo_ callInfo = CallInfo_.CreateMethodCallInfo(target.GetType(), target, methodName, paramTypes, parameters);

            new MethodInvocationEmitter_(callInfo, cache).Execute();
            return(this);
        }
示例#3
0
        private Reflector SetFieldOrProperty(object target, MemberTypes memberTypes, string fieldOrProperty, object value)
        {
            CallInfo_ callInfo = CallInfo_.CreateSetCallInfo(target.GetType(), target, memberTypes, fieldOrProperty, value);

            new AttributeSetEmitter(callInfo, cache).Execute();
            return(this);
        }
示例#4
0
        public ConstructorInvoker DelegateForConstruct(Type targetType, Type[] paramTypes)
        {
            CallInfo_ callInfo = CallInfo_.GetConstructorCallInfo(targetType, paramTypes, null);

            return((ConstructorInvoker) new CtorInvocationEmitter_(callInfo, cache).GetDelegate());
        }
示例#5
0
        public object Construct(Type targetType, Type[] paramTypes, object[] parameters)
        {
            CallInfo_ callInfo = CallInfo_.GetConstructorCallInfo(targetType, paramTypes, parameters);

            return(new CtorInvocationEmitter_(callInfo, cache).Execute <object>());
        }
示例#6
0
        public MethodInvoker DelegateForGetIndexer(Type targetType, Type[] paramTypes)
        {
            CallInfo_ callInfo = CallInfo_.CreateIndexerGetCallInfo(targetType, null, paramTypes, null);

            return((MethodInvoker) new MethodInvocationEmitter_(callInfo, cache).GetDelegate());
        }
示例#7
0
        public TReturn GetIndexer <TReturn>(object target, Type[] paramTypes, object[] parameters)
        {
            CallInfo_ callInfo = CallInfo_.CreateIndexerGetCallInfo(target.GetType(), target, paramTypes, parameters);

            return(new MethodInvocationEmitter_(callInfo, cache).Execute <TReturn>());
        }
示例#8
0
        public MethodInvoker DelegateForInvoke(Type targetType, string methodName, Type[] paramTypes)
        {
            CallInfo_ callInfo = CallInfo_.CreateMethodCallInfo(targetType, null, methodName, paramTypes, null);

            return((MethodInvoker) new MethodInvocationEmitter_(callInfo, cache).GetDelegate());
        }
示例#9
0
        public TReturn Invoke <TReturn>(object target, string methodName, Type[] paramTypes, object[] parameters)
        {
            CallInfo_ callInfo = CallInfo_.CreateMethodCallInfo(target.GetType(), target, methodName, paramTypes, parameters);

            return(new MethodInvocationEmitter_(callInfo, cache).Execute <TReturn>());
        }
示例#10
0
        private AttributeGetter DelegateForGetFieldOrProperty(Type targetType, MemberTypes memberTypes, string fieldOrPropertyName)
        {
            CallInfo_ callInfo = CallInfo_.CreateGetCallInfo(targetType, null, memberTypes, fieldOrPropertyName);

            return((AttributeGetter) new AttributeGetEmitter(callInfo, cache).GetDelegate());
        }
示例#11
0
        private TReturn GetFieldOrProperty <TReturn>(object target, MemberTypes memberTypes, string fieldOrPropertyName)
        {
            CallInfo_ callInfo = CallInfo_.CreateGetCallInfo(target.GetType(), target, memberTypes, fieldOrPropertyName);

            return(new AttributeGetEmitter(callInfo, cache).Execute <TReturn>());
        }
示例#12
0
        private StaticAttributeSetter DelegateForSetStaticFieldOrProperty(Type targetType, MemberTypes memberTypes, string fieldOrProperty)
        {
            CallInfo_ callInfo = CallInfo_.CreateStaticSetCallInfo(targetType, memberTypes, fieldOrProperty, null);

            return((StaticAttributeSetter) new AttributeSetEmitter(callInfo, cache).GetDelegate());
        }