Example #1
0
 private void DefaultVisit(CompareOrphan orphan)
 {
     foreach (var child in orphan.Children)
     {
         Visit(child);
     }
 }
        /// <summary>
        /// Visits a single <see cref="CompareOrphan"/> and produces a value of type <typeparamref name="TResult"/>.
        /// </summary>
        /// <param name="orphan">The orphan to visit.</param>
        /// <returns>If the orphan was not null, the value produced by visiting it. Otherwise, the default value of <typeparamref name="TResult"/>.</returns>
        public virtual TResult Visit(CompareOrphan orphan)
        {
            if (orphan != null)
            {
                return(orphan.Accept(this));
            }

            return(default(TResult));
        }
Example #3
0
 /// <summary>
 /// Visits a single <see cref="TreeNodeType.Node"/> <see cref="CompareOrphan"/>.
 /// </summary>
 /// <param name="orphan">The orphan to visit.</param>
 protected internal abstract void VisitOrphan(CompareOrphan orphan);
Example #4
0
 /// <summary>
 /// Visits a single <see cref="CompareOrphan"/>.
 /// </summary>
 /// <param name="orphan">The orphan to visit.</param>
 public virtual void Visit(CompareOrphan orphan) => orphan.Accept(this);
Example #5
0
 /// <summary>
 /// The action to perform for all orphans whose visitor method is not overridden.
 /// </summary>
 /// <param name="orphan">The orphan to visit.</param>
 protected abstract void DefaultVisit(CompareOrphan orphan);
Example #6
0
 /// <summary>
 /// Visits a single <see cref="CompareOrphan"/>.
 /// </summary>
 /// <param name="orphan">The orphan to visit.</param>
 protected internal override void VisitOrphan(CompareOrphan orphan) => DefaultVisit(orphan);
 /// <summary>
 /// Visits a single <see cref="TreeNodeType.Node"/> <see cref="CompareOrphan"/> and produces a value of type <typeparamref name="TResult"/>.
 /// </summary>
 /// <param name="orphan">The orphan to visit.</param>
 /// <returns>If the orphan was not null, the value produced by visiting it. Otherwise, the default value of <typeparamref name="TResult"/>.</returns>
 protected internal abstract TResult VisitOrphan(CompareOrphan orphan);
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompareOrphanRoot"/> class.
 /// </summary>
 /// <param name="first">The first tree to encapsulate.</param>
 /// <param name="second">The second tree to encapsulate.</param>
 internal CompareOrphanRoot(CompareOrphan first, CompareOrphan second) : base(new[] { first, second })
 {
 }
 public CompareOrphanDebugView(CompareOrphan orphan)
 {
     this.orphan = orphan;
 }