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

FindListItem() private method

private FindListItem ( string name ) : void
name string
return void
        private void FindListItem(string name)
        {
            if (string.IsNullOrEmpty(name))
                return;
            TreeIter iter = TreeIter.Zero;
            _listStore.Foreach((model, path, it) =>
            {
                var item = ((BaseItem)model.GetValue(it, 0));
                if (string.Equals(item.ServerPath.ItemName, name, StringComparison.OrdinalIgnoreCase))
                {
                    iter = it;
                    return true;
                }
                return false;
            });
            if (iter.Equals(TreeIter.Zero))
                return;
            _listView.Selection.SelectIter(iter);
            var treePath = _listStore.GetPath(iter);
            _listView.ScrollToCell(treePath, _listView.Columns[0], false, 0, 0);
        }

Usage Example

        public static void Open(ProjectCollection collection, string path, string fileName)
        {
            foreach (var view in IdeApp.Workbench.Documents)
            {
                var sourceDoc = view.GetContent <SourceControlExplorerView>();
                if (sourceDoc != null)
                {
                    sourceDoc.Load(collection);
                    sourceDoc.ExpandPath(path);
                    sourceDoc.FindListItem(fileName);
                    view.Window.SelectWindow();
                    return;
                }
            }

            var sourceControlExplorerView = new SourceControlExplorerView();

            sourceControlExplorerView.Load(collection);
            sourceControlExplorerView.ExpandPath(path);
            sourceControlExplorerView.FindListItem(fileName);
            IdeApp.Workbench.OpenDocument(sourceControlExplorerView, true);
        }
All Usage Examples Of MonoDevelop.VersionControl.TFS.GUI.VersionControl.SourceControlExplorerView::FindListItem