Ejemplo n.º 1
0
        private void AddChildren(WCTreeNode directory)
        {
            BeginUpdate();
            try
            {
                Items.Clear();

                foreach (WCTreeNode item in directory.GetChildren())
                {
                    WCFileSystemNode fsNode = item as WCFileSystemNode;

                    //SvnItem svnItem = item.SvnItem;
                    if (fsNode == null)
                    {
                        continue;
                    }

                    FileSystemListViewItem lvi = new FileSystemListViewItem(this, fsNode.SvnItem);
                    Items.Add(lvi);
                    lvi.Tag = item;
                }

                if (Items.Count > 0 && _nameColumn.DisplayIndex >= 0)
                {
                    _nameColumn.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
                }
            }
            finally
            {
                EndUpdate();
            }
        }
        private void folderTree_AfterSelect(object sender, TreeViewEventArgs e)
        {
            WCTreeNode item = this.folderTree.SelectedItem;

            if (item == null)
            {
                return;
            }

            this.fileList.SetDirectory(item);
        }
Ejemplo n.º 3
0
        public FileSystemTreeNode(WCTreeNode wcNode, SvnItem item)
        {
            if (wcNode == null)
            {
                throw new ArgumentNullException("wcNode");
            }

            _wcNode = wcNode;
            Text    = wcNode.Title;
            _item   = item;

            wcNode.TreeNode = this;
        }
Ejemplo n.º 4
0
        private TreeNode AddNode(TreeNodeCollection nodes, WCTreeNode child)
        {
            FileSystemTreeNode normalTreeNode = new FileSystemTreeNode(child);

            normalTreeNode.Tag = child;
            normalTreeNode.SelectedImageIndex = normalTreeNode.ImageIndex = child.ImageIndex;
            nodes.Add(normalTreeNode);
            normalTreeNode.Refresh();

            FileSystemTreeNode d = new FileSystemTreeNode("DUMMY");

            normalTreeNode.Nodes.Add(d);
            d.Tag = DummyTag;
            return(normalTreeNode);
        }
Ejemplo n.º 5
0
        internal void FillNode(TreeNode treeNode)
        {
            // get rid of the dummy node or existing nodes
            treeNode.Nodes.Clear();

            WCTreeNode item = treeNode.Tag as WCTreeNode;

            foreach (WCTreeNode child in item.GetChildren())
            {
                if (child.IsContainer)
                {
                    AddNode(treeNode.Nodes, child);
                }
            }
        }
        public void RefreshSelection()
        {
            FileSystemTreeNode tn = (FileSystemTreeNode)folderTree.SelectedNode;

            tn.WCNode.Refresh(true);
            folderTree.FillNode(tn);

            WCTreeNode item = this.folderTree.SelectedItem;

            if (item == null)
            {
                return;
            }

            this.fileList.SetDirectory(item);
        }
Ejemplo n.º 7
0
        public void AddRoot(WCTreeNode rootItem)
        {
            TreeNode tn = this.AddNode(this.Nodes, rootItem);

            this.SelectedNode = tn;
        }
Ejemplo n.º 8
0
        public void SetDirectory(WCTreeNode directory)
        {
            TryInitialize();

            AddChildren(directory);
        }
Ejemplo n.º 9
0
 public FileSystemTreeNode(WCTreeNode wcNode)
     : this(wcNode, null)
 {
 }
 internal void RefreshItem(WCTreeNode item)
 {
     item.Refresh();
 }
 internal void AddRoot(WCTreeNode root)
 {
     this.folderTree.AddRoot(root);
 }