Ejemplo n.º 1
0
        public override MetaObject BindInvokeMember(InvokeMemberBinder binder, MetaObject[] args) {
            ContractUtils.RequiresNotNull(binder, "binder");

            if (args.Any(arg => ComBinderHelpers.IsStrongBoxArg(arg))) {
                return ComBinderHelpers.RewriteStrongBoxAsRef(binder, this, args);
            }

            ComMethodDesc methodDesc;

            if (_wrapperType.Funcs.TryGetValue(binder.Name, out methodDesc) ||
                  _self.TryGetMemberMethodExplicit(binder.Name, out methodDesc)) {
                return new ComInvokeBinder(
                    binder.Arguments,
                    args,
                    IDispatchRestriction(),
                    Expression.Constant(methodDesc),
                    Expression.Property(
                        Expression.Convert(Expression, typeof(IDispatchComObject)),
                        typeof(IDispatchComObject).GetProperty("DispatchObject")
                    ),
                    methodDesc
                ).Invoke();
            }

            return base.BindInvokeMember(binder, args);
        }
Ejemplo n.º 2
0
 public static bool TryBindInvokeMember(InvokeMemberBinder binder, ref MetaObject instance, MetaObject[] args) {
     if (TryGetMetaObject(ref instance)) {
         instance = instance.BindInvokeMember(binder, args);
         return true;
     }
     return false;
 }
Ejemplo n.º 3
0
 public override MetaObject BindInvokeMember(InvokeMemberBinder binder, MetaObject[] args) {
     ContractUtils.RequiresNotNull(binder, "binder");
     return binder.FallbackInvokeMember(UnwrapSelf(), args);
 }
Ejemplo n.º 4
0
 public override MetaObject/*!*/ BindInvokeMember(InvokeMemberBinder/*!*/ binder, params MetaObject/*!*/[]/*!*/ args) {
     var self = (RubyClass)Value;
     return RubyInvokeMemberBinder.TryBind(self.Context, binder, this, args) ?? binder.FallbackInvokeMember(this, args);
 }
Ejemplo n.º 5
0
        public override bool Equals(object obj)
        {
            InvokeMemberBinder ca = obj as InvokeMemberBinder;

            return(ca != null && ca._name == _name && ca._ignoreCase == _ignoreCase && ca._arguments.ListEquals(_arguments));
        }
Ejemplo n.º 6
0
 public virtual MetaObject BindInvokeMember(InvokeMemberBinder binder, MetaObject[] args)
 {
     ContractUtils.RequiresNotNull(binder, "binder");
     return(binder.FallbackInvokeMember(this, args));
 }
Ejemplo n.º 7
0
 public virtual bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result) {
     throw new NotSupportedException();
 }
Ejemplo n.º 8
0
            public override MetaObject BindInvokeMember(InvokeMemberBinder binder, MetaObject[] args) {
                if (IsOverridden("TryInvokeMember")) {
                    return CallMethodWithResult("TryInvokeMember", binder, GetArgArray(args), (e) => binder.FallbackInvokeMember(this, args, e));
                }

                return base.BindInvokeMember(binder, args);
            }
Ejemplo n.º 9
0
 public override MetaObject BindInvokeMember(InvokeMemberBinder binder, MetaObject[] args) {
     ContractUtils.RequiresNotNull(binder, "binder");
     return binder.Defer(args.AddFirst(WrapSelf()));
 }
Ejemplo n.º 10
0
 public virtual MetaObject BindInvokeMember(InvokeMemberBinder binder, MetaObject[] args) {
     ContractUtils.RequiresNotNull(binder, "binder");
     return binder.FallbackInvokeMember(this, args);
 }