예제 #1
0
        /// <summary>
        /// Performs the binding of the dynamic get member operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic get member operation.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackGetMember(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComBinder.TryBindGetMember(this, target, out com, ResultIndexed))
            {
                return(com);
            }
#endif
            return(BinderHelper.Bind(this, _binder, new[] { target }, _argumentInfo, errorSuggestion));
        }
예제 #2
0
        /// <summary>
        /// Performs the binding of the dynamic invoke member operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic invoke member operation.</param>
        /// <param name="args">The arguments of the dynamic invoke member operation.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackInvokeMember(DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComBinder.TryBindInvokeMember(this, target, args, out com))
            {
                return(com);
            }
#endif
            return(BinderHelper.Bind(this, _binder, BinderHelper.Cons(target, args), _argumentInfo, errorSuggestion));
        }
        /// <summary>
        /// Performs the binding of the dynamic invoke operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic invoke operation.</param>
        /// <param name="args">The arguments of the dynamic invoke operation.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackInvoke(DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion)
        {
#if !SILVERLIGHT
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComBinder.TryBindInvoke(this, target, args, out com))
            {
                return(com);
            }
#endif
            return(BinderHelper.Bind(this, m_binder, BinderHelper.Cons(target, args), m_argumentInfo, errorSuggestion));
        }
예제 #4
0
        /// <summary>
        /// Performs the binding of the dynamic set index operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic set index operation.</param>
        /// <param name="indexes">The arguments of the dynamic set index operation.</param>
        /// <param name="value">The value to set to the collection.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackSetIndex(DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComBinder.TryBindSetIndex(this, target, indexes, value, out com))
            {
                return(com);
            }
#endif
            return(BinderHelper.Bind(this, _binder, BinderHelper.Cons(target, indexes, value), _argumentInfo, errorSuggestion));
        }
예제 #5
0
        /// <summary>
        /// Performs the binding of the dynamic convert operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic convert operation.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackConvert(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComBinder.TryConvert(this, target, out com))
            {
                return(com);
            }
#endif
            return(BinderHelper.Bind(this, _binder, new[] { target }, null, errorSuggestion));
        }
        /// <summary>
        /// Performs the binding of the dynamic set member operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic set member operation.</param>
        /// <param name="value">The value to set to the member.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackSetMember(DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
        {
#if !SILVERLIGHT
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComBinder.TryBindSetMember(this, target, value, out com))
            {
                return(com);
            }
#endif
            return(BinderHelper.Bind(this, m_binder, new[] { target, value }, m_argumentInfo, errorSuggestion));
        }
        /// <summary>
        /// Performs the binding of the dynamic set member operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic set member operation.</param>
        /// <param name="value">The value to set to the member.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackSetMember(DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComBinder.TryBindSetMember(this, target, value, out com))
            {
                return(com);
            }
#endif
            BinderHelper.ValidateBindArgument(target, nameof(target));
            BinderHelper.ValidateBindArgument(value, nameof(value));
            return(BinderHelper.Bind(this, _binder, new[] { target, value }, _argumentInfo, errorSuggestion));
        }
예제 #8
0
        /// <summary>
        /// Performs the binding of the dynamic get index operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic get index operation.</param>
        /// <param name="indexes">The arguments of the dynamic get index operation.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackGetIndex(DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComBinder.TryBindGetIndex(this, target, indexes, out com))
            {
                return(com);
            }
#endif
            BinderHelper.ValidateBindArgument(target, nameof(target));
            BinderHelper.ValidateBindArgument(indexes, nameof(indexes));
            return(BinderHelper.Bind(this, _binder, BinderHelper.Cons(target, indexes), _argumentInfo, errorSuggestion));
        }
예제 #9
0
        /// <summary>
        /// Performs the binding of the dynamic convert operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic convert operation.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackConvert(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (ComInterop.ComBinder.TryConvert(this, target, out com))
            {
                return(com);
            }
#else
            BinderHelper.ThrowIfUsingDynamicCom(target);
#endif

            BinderHelper.ValidateBindArgument(target, nameof(target));
            return(BinderHelper.Bind(this, _binder, new[] { target }, null, errorSuggestion));
        }
예제 #10
0
        /// <summary>
        /// Performs the binding of the dynamic get member operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic get member operation.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackGetMember(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComInterop.ComBinder.TryBindGetMember(this, target, out com, ResultIndexed))
            {
                return(com);
            }
#else
            BinderHelper.ThrowIfUsingDynamicCom(target);
#endif

            BinderHelper.ValidateBindArgument(target, nameof(target));
            return(BinderHelper.Bind(this, _binder, new[] { target }, _argumentInfo, errorSuggestion));
        }
예제 #11
0
        /// <summary>
        /// Performs the binding of the dynamic invoke operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic invoke operation.</param>
        /// <param name="args">The arguments of the dynamic invoke operation.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackInvoke(DynamicMetaObject target, DynamicMetaObject[] args, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (!BinderHelper.IsWindowsRuntimeObject(target) && ComBinder.TryConvert(this, target, out com))
            {
                return(com);
            }
#else
            BinderHelper.ThrowIfUsingDynamicCom(target);
#endif

            BinderHelper.ValidateBindArgument(target, nameof(target));
            BinderHelper.ValidateBindArgument(args, nameof(args));
            return(BinderHelper.Bind(this, _binder, BinderHelper.Cons(target, args), _argumentInfo, errorSuggestion));
        }
예제 #12
0
        /// <summary>
        /// Performs the binding of the dynamic set member operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic set member operation.</param>
        /// <param name="value">The value to set to the member.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackSetMember(DynamicMetaObject target, DynamicMetaObject value, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (ComInterop.ComBinder.TryBindSetMember(this, target, value, out com))
            {
                return(com);
            }
#else
            BinderHelper.ThrowIfUsingDynamicCom(target);
#endif

            BinderHelper.ValidateBindArgument(target, nameof(target));
            BinderHelper.ValidateBindArgument(value, nameof(value));
            return(BinderHelper.Bind(this, _binder, new[] { target, value }, _argumentInfo, errorSuggestion));
        }
예제 #13
0
        /// <summary>
        /// Performs the binding of the dynamic get index operation if the target dynamic object cannot bind.
        /// </summary>
        /// <param name="target">The target of the dynamic get index operation.</param>
        /// <param name="indexes">The arguments of the dynamic get index operation.</param>
        /// <param name="errorSuggestion">The binding result to use if binding fails, or null.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public override DynamicMetaObject FallbackGetIndex(DynamicMetaObject target, DynamicMetaObject[] indexes, DynamicMetaObject errorSuggestion)
        {
#if ENABLECOMBINDER
            DynamicMetaObject com;
            if (ComInterop.ComBinder.TryBindGetIndex(this, target, indexes, out com))
            {
                return(com);
            }
#else
            BinderHelper.ThrowIfUsingDynamicCom(target);
#endif

            BinderHelper.ValidateBindArgument(target, nameof(target));
            BinderHelper.ValidateBindArgument(indexes, nameof(indexes));
            return(BinderHelper.Bind(this, _binder, BinderHelper.Cons(target, indexes), _argumentInfo, errorSuggestion));
        }
예제 #14
0
 /// <summary>
 /// Performs the binding of the binary dynamic operation if the target dynamic object cannot bind.
 /// </summary>
 /// <param name="target">The target of the dynamic binary operation.</param>
 /// <param name="args">The arguments to the dynamic event test.</param>
 /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
 public override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args)
 {
     return BinderHelper.Bind(this, _binder, new DynamicMetaObject[] { target }, null, null);
 }
예제 #15
0
 /// <summary>
 /// Performs the binding of the unary dynamic operation if the target dynamic object cannot bind.
 /// </summary>
 /// <param name="target">The target of the dynamic unary operation.</param>
 /// <param name="errorSuggestion">The binding result in case the binding fails, or null.</param>
 /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
 public sealed override DynamicMetaObject FallbackUnaryOperation(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
 {
     return(BinderHelper.Bind(this, _binder, new[] { target }, _argumentInfo, errorSuggestion));
 }
 public sealed override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args)
 {
     return(BinderHelper.Bind(this, _binder, BinderHelper.Cons(target, args), _argumentInfo, null));
 }
예제 #17
0
 /// <summary>
 /// Performs the binding of the binary dynamic operation if the target dynamic object cannot bind.
 /// </summary>
 /// <param name="target">The target of the dynamic binary operation.</param>
 /// <param name="arg">The right hand side operand of the dynamic binary operation.</param>
 /// <param name="errorSuggestion">The binding result in case the binding fails, or null.</param>
 /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
 public sealed override DynamicMetaObject FallbackBinaryOperation(DynamicMetaObject target, DynamicMetaObject arg, DynamicMetaObject errorSuggestion)
 {
     return(BinderHelper.Bind(this, m_binder, BinderHelper.Cons(target, null, arg), m_argumentInfo, errorSuggestion));
 }
 /// <summary>
 /// Performs the binding of the unary dynamic operation if the target dynamic object cannot bind.
 /// </summary>
 /// <param name="target">The target of the dynamic unary operation.</param>
 /// <param name="errorSuggestion">The binding result in case the binding fails, or null.</param>
 /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
 public override DynamicMetaObject FallbackUnaryOperation(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
 {
     BinderHelper.ValidateBindArgument(target, nameof(target));
     return(BinderHelper.Bind(this, _binder, new[] { target }, _argumentInfo, errorSuggestion));
 }
예제 #19
0
 public override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args)
 {
     BinderHelper.ValidateBindArgument(target, nameof(target));
     BinderHelper.ValidateBindArgument(args, nameof(args));
     return(BinderHelper.Bind(this, _binder, BinderHelper.Cons(target, args), _argumentInfo, null));
 }
예제 #20
0
 /// <summary>
 /// Performs the binding of the binary dynamic operation if the target dynamic object cannot bind.
 /// </summary>
 /// <param name="target">The target of the dynamic binary operation.</param>
 /// <param name="args">The arguments to the dynamic event test.</param>
 /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
 public override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args)
 {
     BinderHelper.ValidateBindArgument(target, nameof(target));
     return(BinderHelper.Bind(this, _binder, new [] { target }, null, null));
 }