Ejemplo n.º 1
0
        internal MetaObject Invoke()
        {
            _keywordArgNames = GetArgumentNames();
            // will not include implicit instance argument (if any)
            Type[] explicitArgTypes = _args.Map(a => a.LimitType);
            Type[] marshalArgTypes  = _args.Map(a => MarshalType(a));

            Expression[] explicitArgExprs = _args.Map(a => a.Expression);
            _totalExplicitArgs = explicitArgTypes.Length;

            _varEnumSelector = new VarEnumSelector(marshalArgTypes);

            // We already tested the instance, so no need to test it again
            for (int i = 0; i < explicitArgTypes.Length; i++)
            {
                _restrictions = _restrictions.Merge(Restrictions.GetTypeRestriction(explicitArgExprs[i], explicitArgTypes[i]));
            }

            return(new MetaObject(
                       CreateScope(MakeIDispatchInvokeTarget()),
                       Restrictions.Combine(_args).Merge(_restrictions)
                       ));
        }
Ejemplo n.º 2
0
        internal MetaObject Invoke() {
            _keywordArgNames = GetArgumentNames();
            // will not include implicit instance argument (if any)
            Type[] explicitArgTypes = _args.Map(a => a.LimitType);
            Type[] marshalArgTypes = _args.Map(a => MarshalType(a));

            Expression[] explicitArgExprs = _args.Map(a => a.Expression);
            _totalExplicitArgs = explicitArgTypes.Length;

            _varEnumSelector = new VarEnumSelector(marshalArgTypes);

            // We already tested the instance, so no need to test it again
            for (int i = 0; i < explicitArgTypes.Length; i++) {
                _restrictions = _restrictions.Merge(Restrictions.GetTypeRestriction(explicitArgExprs[i], explicitArgTypes[i]));
            }

            return new MetaObject(
                CreateScope(MakeIDispatchInvokeTarget()),
                Restrictions.Combine(_args).Merge(_restrictions)
            );
        }