MonoDevelop.VersionControl.TFS.GUI.VersionControl.SourceControlExplorerView.ExpandPath C# (CSharp) Method

ExpandPath() private method

private ExpandPath ( string path ) : void
path string
return void
        private void ExpandPath(string path)
        {
            if (string.IsNullOrEmpty(path))
                return;
            TreeIter iter = TreeIter.Zero;
            _treeStore.Foreach((m, p, i) =>
            {
                var item = ((BaseItem)m.GetValue(i, 0));
                if (string.Equals(item.ServerPath, path, StringComparison.OrdinalIgnoreCase))
                {
                    iter = i;
                    return true;
                }
                return false;
            });

            if (iter.Equals(TreeIter.Zero))
                return;
            _treeView.CollapseAll();
            _treeView.ExpandToPath(_treeStore.GetPath(iter));
            _treeView.Selection.SelectIter(iter);
        }

Usage Example

        public static void Open(ProjectInfo project)
        {
            foreach (var view in IdeApp.Workbench.Documents)
            {
                var sourceDoc = view.GetContent<SourceControlExplorerView>();
                if (sourceDoc != null)
                {
                    sourceDoc.Load(project.Collection);
                    sourceDoc.ExpandPath(VersionControlPath.RootFolder + project.Name);
                    view.Window.SelectWindow();
                    return;
                }
            }

            var sourceControlExplorerView = new SourceControlExplorerView();
            sourceControlExplorerView.Load(project.Collection);
            sourceControlExplorerView.ExpandPath(VersionControlPath.RootFolder + project.Name);
            IdeApp.Workbench.OpenDocument(sourceControlExplorerView, true);
        }
All Usage Examples Of MonoDevelop.VersionControl.TFS.GUI.VersionControl.SourceControlExplorerView::ExpandPath