コード例 #1
0
        /// <summary>
        /// Performs binding of the operation on the target (represented as meta object) and
        /// list of arguments (indexes and right-hand value) represented as meta objects
        /// </summary>
        /// <param name="target">Target of the operation.</param>
        /// <param name="args">List of indexes and right-hand value</param>
        /// <returns>MetaObject representing the binding.</returns>
        public sealed override MetaObject Bind(MetaObject target, MetaObject[] args)
        {
            ContractUtils.RequiresNotNull(target, "target");
            ContractUtils.RequiresNotNull(args, "args");
            ContractUtils.Requires(args.Length >= 2, "args");

            MetaObject value = args[args.Length - 1];

            MetaObject[] indexes = args.RemoveLast();

            ContractUtils.RequiresNotNull(value, "args");
            ContractUtils.RequiresNotNullItems(indexes, "args");

            return(target.BindBinaryOperationOnIndex(this, indexes, value));
        }
コード例 #2
0
        /// <summary>
        /// Performs binding of the operation on the target (represented as meta object) and
        /// list of arguments (indexes and right-hand value) represented as meta objects
        /// </summary>
        /// <param name="target">Target of the operation.</param>
        /// <param name="args">List of indexes and right-hand value</param>
        /// <returns>MetaObject representing the binding.</returns>
        public sealed override MetaObject Bind(MetaObject target, MetaObject[] args) {
            ContractUtils.RequiresNotNull(target, "target");
            ContractUtils.RequiresNotNull(args, "args");
            ContractUtils.Requires(args.Length >= 2, "args");

            MetaObject value = args[args.Length - 1];
            MetaObject[] indexes = args.RemoveLast();

            ContractUtils.RequiresNotNull(value, "args");
            ContractUtils.RequiresNotNullItems(indexes, "args");

            return target.BindBinaryOperationOnIndex(this, indexes, value);
        }