Exemplo n.º 1
0
 public DynamicInstructionN(Type delegateType, CallSite site)
 {
     MethodInfo method = delegateType.GetMethod("Invoke");
     ParameterInfo[] parameters = method.GetParameters();
     this._target = CallInstruction.Create(method, parameters);
     this._site = site;
     this._argumentCount = parameters.Length - 1;
     this._targetDelegate = site.GetType().GetField("Target").GetValue(site);
 }
Exemplo n.º 2
0
        public DynamicInstructionN(Type delegateType, CallSite site)
        {
            var methodInfo = delegateType.GetMethod("Invoke");
            var parameters = methodInfo.GetParameters();

            _target = CallInstruction.Create(methodInfo, parameters);
            _site = site;
            _argumentCount = parameters.Length - 1;
            _targetDelegate = site.GetType().GetField("Target").GetValue(site);
        }
Exemplo n.º 3
0
 public void EmitCall(MethodInfo method, ParameterInfo[] parameters)
 {
     Emit(CallInstruction.Create(method, parameters));
 }