示例#1
0
 /// <summary>
 /// Removes the case branch.
 /// </summary>
 /// <param name="branch">The branch to be removed.</param>
 /// <returns>True if branch was found; otherwise, false.</returns>
 public bool RemoveBranch(ConditionalCaseBranch branch)
 {
     if (branch == null)
     {
         throw new ArgumentNullException("branch");
     }
     return(branches.Remove(branch));
 }
示例#2
0
 /// <summary>
 /// Adds the case option to the case expression.
 /// </summary>
 /// <param name="filter">The value that the case item must equal for given the result to be returned.</param>
 /// <param name="result">The value to return when the item equals the option.</param>
 public ConditionalCaseBranch AddBranch(IFilter filter, IProjectionItem result)
 {
     if (filter == null)
     {
         throw new ArgumentNullException("filter");
     }
     if (result == null)
     {
         throw new ArgumentNullException("result");
     }
     ConditionalCaseBranch branch = new ConditionalCaseBranch();
     branch.Condition = filter;
     branch.Value = result;
     branches.Add(branch);
     return branch;
 }
示例#3
0
        /// <summary>
        /// Adds the case option to the case expression.
        /// </summary>
        /// <param name="filter">The value that the case item must equal for given the result to be returned.</param>
        /// <param name="result">The value to return when the item equals the option.</param>
        public ConditionalCaseBranch AddBranch(IFilter filter, IProjectionItem result)
        {
            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }
            if (result == null)
            {
                throw new ArgumentNullException("result");
            }
            ConditionalCaseBranch branch = new ConditionalCaseBranch();

            branch.Condition = filter;
            branch.Value     = result;
            branches.Add(branch);
            return(branch);
        }
示例#4
0
 /// <summary>
 /// Removes the case branch.
 /// </summary>
 /// <param name="branch">The branch to be removed.</param>
 /// <returns>True if branch was found; otherwise, false.</returns>
 public bool RemoveBranch(ConditionalCaseBranch branch)
 {
     if (branch == null)
     {
         throw new ArgumentNullException("branch");
     }
     return branches.Remove(branch);
 }