/// <summary>Adds a <see cref="BaseBranchNode"/>, and recursivley, its children.</summary>
        TreeNode OnAddBranchNode(TreeNodeCollection nodes, BaseBranchNode branchNode)
        {
            bool     isBranch = branchNode is BranchNode;
            TreeNode treeNode = new TreeNode(branchNode.Name)
            {
                Name             = branchNode.FullPath,
                Tag              = branchNode,
                ContextMenuStrip = isBranch ? menuBranch : menuBranchPath,
                ImageKey         = isBranch ? branchKey : branchPathKey,
                SelectedImageKey = isBranch ? branchKey : branchPathKey,
            };

            nodes.Add(treeNode);
            branchNode.TreeNode = treeNode;

            BranchPathNode branchPath = branchNode as BranchPathNode;

            if (branchPath != null)
            {
                foreach (BaseBranchNode child in branchPath.Children)
                {// recurse children
                    OnAddBranchNode(treeNode.Nodes, child);
                }
            }

            return(null);// return null bypass duplicate call to ApplyStyle
        }
            private bool Equals(BaseBranchNode other)
            {
                if (other == null)
                {
                    return(false);
                }

                return(ReferenceEquals(other, this) || string.Equals(FullPath, other.FullPath));
            }
            /// <summary>Two <see cref="BaseBranchNode"/> instances are equal
            ///  if their <see cref="FullPath"/> values are equal.</summary>
            protected bool Equals(BaseBranchNode other)
            {
                if (other == null)
                {
                    return(false);
                }

                return((other == this) || string.Equals(FullPath, other.FullPath));
            }
 protected bool Equals(BaseBranchNode other)
 {
     if (other == null)
     {
         return(false);
     }
     return((other == this)
            ||
            ((IsLocal && other.IsLocal) && string.Equals(_FullPath, other._FullPath)));
 }
            /// <summary>Gets the hierarchical branch tree from the specified list of <paramref name="branches"/>.</summary>
            public void FillBranchTree(IEnumerable <string> branches)
            {
                #region ex

                // (input)
                // a-branch
                // develop/crazy-branch
                // develop/features/feat-next
                // develop/features/feat-next2
                // develop/issues/iss444
                // develop/wild-branch
                // issues/iss111
                // master
                //
                // ->
                // (output)
                // 0 a-branch
                // 0 develop/
                // 1   features/
                // 2      feat-next
                // 2      feat-next2
                // 1   issues/
                // 2      iss444
                // 1   wild-branch
                // 1   wilds/
                // 2      card
                // 0 issues/
                // 1     iss111
                // 0 master

                #endregion ex

                Dictionary <string, BaseBranchNode> nodes = new Dictionary <string, BaseBranchNode>();
                var branchFullPaths = new List <string>();
                foreach (string branch in branches)
                {
                    BranchNode     branchNode = new BranchNode(this, branch);
                    BaseBranchNode parent     = branchNode.CreateRootNode(nodes,
                                                                          (tree, parentPath) => new BranchPathNode(tree, parentPath));
                    if (parent != null)
                    {
                        Nodes.AddNode(parent);
                    }
                    branchFullPaths.Add(branchNode.FullPath);
                }

                FireBranchAddedEvent(branchFullPaths);
            }
 private void FilterInRevisionGrid(BaseBranchNode branch)
 {
     _filterBranchHelper?.SetBranchFilter(branch.FullPath, refresh: true);
 }
            /// <summary>Two <see cref="BaseBranchNode"/> instances are equal
            ///  if their <see cref="FullPath"/> values are equal.</summary>
            protected bool Equals(BaseBranchNode other)
            {
                if (other == null)
                {
                    return false;
                }

                return (other == this) || string.Equals(FullPath, other.FullPath);
            }
            public override bool Equals(object obj)
            {
                BaseBranchNode branchNode = obj as BaseBranchNode;

                return(branchNode != null && Equals(branchNode));
            }