示例#1
0
        /// <summary>
        /// Creates a REMOVE operation for the specified node.
        /// </summary>
        /// <param name="node">The node to be removed.</param>
        /// <returns>An operation pair for the node and the REMOVE operation.
        /// </returns>
        private OperationPair CreateRemoveOperation(ProductPartitionNode node)
        {
            PreconditionUtilities.CheckArgument(node.ProductPartitionId >= NEW_ROOT_ID,
                                                string.Format(ShoppingMessages.NodeForRemoveCannotHaveNegativeId,
                                                              node.ProductPartitionId));

            AdGroupCriterionOperation removeOp = new AdGroupCriterionOperation();

            removeOp.@operator = Operator.REMOVE;
            removeOp.operand   = ProductPartitionNodeAdapter.CreateCriterionForRemove(node, adGroupId);

            return(new OperationPair(node, removeOp));
        }