Create() 공개 정적인 메소드

public static Create ( MethodInfo info ) : CallInstruction
info System.Reflection.MethodInfo
리턴 CallInstruction
예제 #1
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);
        }
예제 #2
0
        public DynamicInstructionN(Type delegateType, CallSite site)
        {
            var methodInfo = delegateType.GetMethod("Invoke");
            var parameters = methodInfo.GetParameters();

            // <Delegate>.Invoke is ok to target by a delegate in partial trust (SecurityException is not thrown):
            _targetInvocationInstruction = CallInstruction.Create(methodInfo, parameters);
            _site           = site;
            _argumentCount  = parameters.Length - 1;
            _targetDelegate = site.GetType().GetInheritedFields("Target").First().GetValue(site);
        }
예제 #3
0
 public void EmitCall(MethodInfo method, ParameterInfo[] parameters)
 {
     Emit(CallInstruction.Create(method, parameters));
 }