Пример #1
0
        internal IntPtr InvokeObjectArrayDelegate(object[] arguments)
        {
            if (!_conversionInfo.IsObjectArrayDelegateThunk)
            {
                Environment.FailFast("Thunk is not an object array delegate thunk!");
            }

            Debug.Assert(!_delegateData.Equals(default(DelegateData)));

            Func <object[], object> targetDelegate = _delegateData._helperObject as Func <object[], object>;

            Debug.Assert(targetDelegate != null);

            s_pinnedGCHandles._returnObjectHandle.Target = targetDelegate(arguments ?? Array.Empty <object>());

            return(RuntimeAugments.GetRawAddrOfPinnedObject((IntPtr)s_pinnedGCHandles._returnObjectHandle));
        }