// Compare the length of the strings, or the strings
        // themselves, if they are the same length.
        public int Compare(object x, object y)
        {
            DirectoryTreeNode tX = x as DirectoryTreeNode;
            DirectoryTreeNode tY = y as DirectoryTreeNode;

            return(tX.TotalSize.CompareTo(tY.TotalSize) * -1);
        }
Exemple #2
0
        private void display(Directory directory, ulong totalSize)
        {
            if (directory.loaded == false)
            {
                return;
            }

            DirectoryTreeNode childNode = new DirectoryTreeNode(directory);

            form.AddTreeNode(childNode, totalSize);
        }
        public DirectoryTreeNode(Directory directory)
        {
            this.directory = directory;
            base.Text      = GetText();

            foreach (Directory child in directory.children)
            {
                TreeNode childNode = new DirectoryTreeNode(child);

                Nodes.Add(childNode);
            }
        }
        internal void AddTreeNode(DirectoryTreeNode node, ulong totalSize)
        {
            if (treeView1.InvokeRequired)
            {
                treeView1.Invoke(new AddTreeNodeCallback(AddTreeNode), node, totalSize);
            }
            else
            {
                foreach (DirectoryTreeNode child in treeView1.Nodes)
                {
                    child.Refresh(totalSize);
                }

                treeView1.Nodes.Add(node);
            }
        }