public sealed override Object Invoke(Object thisObject, Object[] arguments) { MethodInvokerUtils.ValidateThis(thisObject, _declaringTypeHandle); return(RuntimeAugments.CallDynamicInvokeMethod( thisObject, MethodInvokeInfo.LdFtnResult, null, MethodInvokeInfo.DynamicInvokeMethod, MethodInvokeInfo.DynamicInvokeGenericDictionary, MethodInvokeInfo.DefaultValueString, arguments, invokeMethodHelperIsThisCall: false, methodToCallIsThisCall: true)); }
public sealed override Object Invoke(Object thisObject, Object[] arguments) { MethodInvokerUtils.ValidateThis(thisObject, _declaringTypeHandle); IntPtr resolvedVirtual = OpenMethodResolver.ResolveMethod(MethodInvokeInfo.VirtualResolveData, thisObject); Object result = RuntimeAugments.CallDynamicInvokeMethod( thisObject, resolvedVirtual, null, MethodInvokeInfo.DynamicInvokeMethod, MethodInvokeInfo.DynamicInvokeGenericDictionary, MethodInvokeInfo.DefaultValueString, arguments, invokeMethodHelperIsThisCall: false, methodToCallIsThisCall: true); return(result); }
public sealed override Object Invoke(Object thisObject, Object[] arguments) { MethodInvokerUtils.ValidateThis(thisObject, _declaringTypeHandle); object result = RuntimeAugments.CallDynamicInvokeMethod( thisObject, MethodInvokeInfo.LdFtnResult, null /*thisPtrDynamicInvokeMethod*/, MethodInvokeInfo.DynamicInvokeMethod, MethodInvokeInfo.DynamicInvokeGenericDictionary, MethodInvokeInfo.MethodInfo, arguments, invokeMethodHelperIsThisCall: false, methodToCallIsThisCall: true); System.Diagnostics.DebugAnnotations.PreviousCallContainsDebuggerStepInCode(); return(result); }
public sealed override Object Invoke(Object thisObject, Object[] arguments, BinderBundle binderBundle) { MethodInvokerUtils.ValidateThis(thisObject, _declaringTypeHandle); IntPtr resolvedVirtual = OpenMethodResolver.ResolveMethod(MethodInvokeInfo.VirtualResolveData, thisObject); Object result = RuntimeAugments.CallDynamicInvokeMethod( thisObject, resolvedVirtual, null /*thisPtrDynamicInvokeMethod*/, MethodInvokeInfo.DynamicInvokeMethod, MethodInvokeInfo.DynamicInvokeGenericDictionary, MethodInvokeInfo.MethodInfo, arguments, binderBundle, invokeMethodHelperIsThisCall: false, methodToCallIsThisCall: true); System.Diagnostics.DebugAnnotations.PreviousCallContainsDebuggerStepInCode(); return(result); }
public override Object Invoke(Object thisObject, Object[] arguments, BinderBundle binderBundle) { //@todo: This does not handle optional parameters (nor does it need to as today we're only using it for three synthetic array methods.) if (!(thisObject == null && 0 != (_options & InvokerOptions.AllowNullThis))) { MethodInvokerUtils.ValidateThis(thisObject, _thisType); } if (arguments == null) { arguments = Array.Empty <Object>(); } if (arguments.Length != _parameterTypes.Length) { throw new TargetParameterCountException(); } Object[] convertedArguments = new Object[arguments.Length]; for (int i = 0; i < arguments.Length; i++) { convertedArguments[i] = RuntimeAugments.CheckArgument(arguments[i], _parameterTypes[i], binderBundle); } Object result; try { result = _invoker(thisObject, convertedArguments); } catch (Exception e) { if (0 != (_options & InvokerOptions.DontWrapException)) { throw; } else { throw new TargetInvocationException(e); } } return(result); }