Exemple #1
0
        private static Branch RecursivelyProcessBranch(BranchObject bo, VersionControlServer vcs)
        {
            var rtnVal = new Branch {Name = bo.Properties.RootItem.Item, Text = bo.Properties.RootItem.Item};

            var childBos = vcs.QueryBranchObjects(bo.Properties.RootItem, RecursionType.OneLevel);

            foreach (var branchObject in childBos)
            {
                if (branchObject.Properties.RootItem.Item != bo.Properties.RootItem.Item)
                    rtnVal.Nodes.Add(RecursivelyProcessBranch(branchObject, vcs));
            }

            return rtnVal;
        }
Exemple #2
0
        /// <summary>
        /// Display all brannches
        /// </summary>
        /// <param name="bo">
        /// oggetto branch
        /// </param>
        /// <param name="vcs">
        /// version control server
        /// </param>
        /// <param name="tp">
        /// Team project
        /// </param>
        private static void DisplayAllBranches(BranchObject bo, VersionControlServer vcs, string tp)
        {
            // 0.Prepare display indentation
            for (int tabcounter = 0; tabcounter < recursionlevel; tabcounter++)
            {
                ritorno.Add("\t");
            }

            // 1.Display the current branch
            ritorno.Add(string.Format("{0}", bo.Properties.RootItem.Item));

            // 2.Query all child branches (one level deep)
            BranchObject[] childBos = vcs.QueryBranchObjects(bo.Properties.RootItem, RecursionType.OneLevel);

            // 3.Display all children recursively
            recursionlevel++;
            foreach (BranchObject child in childBos)
            {
                if (child.Properties.RootItem.Item == bo.Properties.RootItem.Item)
                {
                    continue;
                }

                DisplayAllBranches(child, vcs, tp);
            }

            recursionlevel--;
        }
Exemple #3
0
        private void LoadBranchObjects(BranchObject bo, VersionControlServer vcs, bool isDeleted)
        {
            if (bo.Properties.RootItem.IsDeleted == isDeleted)
                _listOfBranchesObj.Add(bo);

            var childBos = vcs.QueryBranchObjects(bo.Properties.RootItem, RecursionType.OneLevel);
            foreach (var child in childBos)
            {
                if (child.Properties.RootItem.Item == bo.Properties.RootItem.Item)
                    continue;

                LoadBranchObjects(child, vcs, isDeleted);
            }
        }