Esempio n. 1
0
        public void FillTreeView()
        {
            _treeStore.Clear();
            var versionControl = this.projectCollection.GetService <RepositoryService>();
            var items          = versionControl.QueryItems(new ItemSpec(VersionControlPath.RootFolder, RecursionType.Full), VersionSpec.Latest, DeletedState.NonDeleted, ItemType.Folder, false);
            var root           = ItemSetToHierarchItemConverter.Convert(items);
            var node           = _treeStore.AddNode().SetValue(_name, root.Name).SetValue(_path, root.ServerPath);

            AddChilds(node, root.Children);
            var topNode = _treeStore.GetFirstNode();

            treeView.ExpandRow(topNode.CurrentPosition, false);
        }
        private void FillTreeView()
        {
            _treeStore.Clear();
            var versionControl = projectCollection.GetService <RepositoryService>();
            var items          = versionControl.QueryItems(this._currentWorkspace, new ItemSpec(VersionControlPath.RootFolder, RecursionType.Full), VersionSpec.Latest, DeletedState.NonDeleted, ItemType.Folder, false);

            var root = ItemSetToHierarchItemConverter.Convert(items);
            var node = _treeStore.AppendNode();

            _treeStore.SetValues(node, root.Item, GetRepositoryImage(), root.Name);
            AddChilds(node, root.Children);
            TreeIter firstNode;

            if (_treeStore.GetIterFirst(out firstNode))
            {
                _treeView.ExpandRow(_treeStore.GetPath(firstNode), false);
                _treeView.Selection.SelectIter(firstNode);
            }
            _treeView.Model = _treeStore;
        }