Combine() public static method

Combines binding restrictions from the list of DynamicMetaObject instances into one set of restrictions.
public static Combine ( IList contributingObjects ) : BindingRestrictions
contributingObjects IList The list of instances from which to combine restrictions.
return BindingRestrictions
コード例 #1
0
        /// <summary>
        /// Defers the binding of the operation until later time when the runtime values of all dynamic operation arguments have been computed.
        /// </summary>
        /// <param name="target">The target of the dynamic operation.</param>
        /// <param name="args">An array of arguments of the dynamic operation.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public DynamicMetaObject Defer(DynamicMetaObject target, params DynamicMetaObject[] args)
        {
            ContractUtils.RequiresNotNull(target, nameof(target));

            if (args == null)
            {
                return(MakeDeferred(target.Restrictions, target));
            }

            return(MakeDeferred(
                       target.Restrictions.Merge(BindingRestrictions.Combine(args)),
                       args.AddFirst(target)
                       ));
        }
コード例 #2
0
        /// <summary>
        /// Defers the binding of the operation until later time when the runtime values of all dynamic operation arguments have been computed.
        /// </summary>
        /// <param name="target">The target of the dynamic operation.</param>
        /// <param name="args">An array of arguments of the dynamic operation.</param>
        /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
        public DynamicMetaObject Defer(DynamicMetaObject target, params DynamicMetaObject[]?args)
        {
            ArgumentNullException.ThrowIfNull(target);

            if (args == null)
            {
                return(MakeDeferred(target.Restrictions, target));
            }
            else
            {
                return(MakeDeferred(
                           target.Restrictions.Merge(BindingRestrictions.Combine(args)),
                           args.AddFirst(target)
                           ));
            }
        }
コード例 #3
0
 /// <summary>
 /// Defers the binding of the operation until later time when the runtime values of all dynamic operation arguments have been computed.
 /// </summary>
 /// <param name="args">An array of arguments of the dynamic operation.</param>
 /// <returns>The <see cref="DynamicMetaObject"/> representing the result of the binding.</returns>
 public DynamicMetaObject Defer(params DynamicMetaObject[] args)
 {
     return(MakeDeferred(BindingRestrictions.Combine(args), args));
 }