Example #1
0
        internal DynamicMetaObject Invoke() {
            _keywordArgNames = GetArgumentNames();
            _totalExplicitArgs = _args.Length;
            
            Type[] marshalArgTypes = new Type[_args.Length];

            // We already tested the instance, so no need to test it again
            for (int i = 0; i < _args.Length; i++) {
                DynamicMetaObject curMo = _args[i];
                _restrictions = _restrictions.Merge(BindingRestrictions.GetTypeRestriction(curMo.Expression, curMo.LimitType));
                marshalArgTypes[i] = MarshalType(curMo);
            }

            _varEnumSelector = new VarEnumSelector(marshalArgTypes);

            return new DynamicMetaObject(
                CreateScope(MakeIDispatchInvokeTarget()),
                BindingRestrictions.Combine(_args).Merge(_restrictions)
            );
        }
Example #2
0
        internal DynamicMetaObject Invoke() {
            _keywordArgNames = _callInfo.ArgumentNames.ToArray();
            _totalExplicitArgs = _args.Length;
            
            Type[] marshalArgTypes = new Type[_args.Length];

            // We already tested the instance, so no need to test it again
            for (int i = 0; i < _args.Length; i++) {
                DynamicMetaObject curMo = _args[i];
                _restrictions = _restrictions.Merge(ComBinderHelpers.GetTypeRestrictionForDynamicMetaObject(curMo));
                marshalArgTypes[i] = MarshalType(curMo, _isByRef[i]);
            }

            _varEnumSelector = new VarEnumSelector(marshalArgTypes);

            return new DynamicMetaObject(
                CreateScope(MakeIDispatchInvokeTarget()),
                BindingRestrictions.Combine(_args).Merge(_restrictions)
            );
        }