コード例 #1
0
        // <summary>
        // Method for copying "virtual" tree branch; called recursively
        // </summary>
        private void CopyVirtualBranch(MyTreeNode start, FolderInventoryNode root)
        {
            start.virtualNode = root;
            if (root.Items.Count > 0)
            {
                IOrderedEnumerable <FolderInventoryNode> items;
                if (_current_sort_order == SortOrder.Alpha)
                {
                    items = (IOrderedEnumerable <FolderInventoryNode>)root.Items.OrderBy(t => t.Name);
                }
                else
                {
                    items = (IOrderedEnumerable <FolderInventoryNode>)root.Items.OrderByDescending(t => t.TotalWeight);
                }

                foreach (FolderInventoryNode item in items)
                {
                    MyTreeNode treenode = new MyTreeNode(item.ToString(_active_measure_unit, _LocRM));
                    treenode.BackColor = item.GetColorByDirInfo(treenode.ForeColor);
                    start.Nodes.Add(treenode);

                    CopyVirtualBranch(treenode, item);
                }
            }
        }
コード例 #2
0
        private void UpdateAllVisibleTreeNodes(MyTreeNode root)
        {
            if (root == null)
            {
                return;
            }
            if (root.virtualNode != null)
            {
                root.Text = root.virtualNode.ToString(_active_measure_unit, _LocRM);
            }

            foreach (MyTreeNode node in root.Nodes)
            {
                UpdateAllVisibleTreeNodes(node);
            }
        }
コード例 #3
0
        // <summary>
        // Method for rebuilding TreeView by already built "virtual" Tree
        // </summary>
        public void RepopulateTreeView()
        {
            FolderInventoryNode internal_root = _folder_inventory.Root;

            if (internal_root == null)
            {
                return;
            }
            string     path  = internal_root.Name;
            MyTreeNode start = new MyTreeNode(path);

            tvInventory.Nodes.Clear();

            tvInventory.Nodes.Add(start);

            CopyVirtualBranch(start, internal_root);
            start.Text = internal_root.ToString(_active_measure_unit, _LocRM);
        }
コード例 #4
0
ファイル: main.cs プロジェクト: 62mkv/FileInventory
        // <summary>
        // Method for rebuilding TreeView by already built "virtual" Tree
        // </summary>
        public void RepopulateTreeView()
        {
            FolderInventoryNode internal_root = _folder_inventory.Root;
            if (internal_root == null) { return; }
            string path = internal_root.Name;
            MyTreeNode start = new MyTreeNode(path);
            tvInventory.Nodes.Clear();

            tvInventory.Nodes.Add(start);

            CopyVirtualBranch(start, internal_root);
            start.Text = internal_root.ToString(_active_measure_unit, _LocRM);
        }
コード例 #5
0
ファイル: main.cs プロジェクト: 62mkv/FileInventory
        private void UpdateAllVisibleTreeNodes(MyTreeNode root)
        {
            if (root == null) { return; }
            if (root.virtualNode != null)
            {
              root.Text = root.virtualNode.ToString(_active_measure_unit, _LocRM);
            }

            foreach (MyTreeNode node in root.Nodes)
            {
                UpdateAllVisibleTreeNodes(node);
            }
        }
コード例 #6
0
ファイル: main.cs プロジェクト: 62mkv/FileInventory
        // <summary>
        // Method for copying "virtual" tree branch; called recursively
        // </summary>
        private void CopyVirtualBranch(MyTreeNode start, FolderInventoryNode root)
        {
            start.virtualNode = root;
            if (root.Items.Count > 0)
            {
                IOrderedEnumerable<FolderInventoryNode> items;
                if (_current_sort_order == SortOrder.Alpha)
                {
                    items = (IOrderedEnumerable<FolderInventoryNode>)root.Items.OrderBy(t => t.Name);
                }
                else
                {
                    items = (IOrderedEnumerable<FolderInventoryNode>)root.Items.OrderByDescending(t => t.TotalWeight);
                }

                foreach (FolderInventoryNode item in items)
                {
                    MyTreeNode treenode = new MyTreeNode(item.ToString(_active_measure_unit, _LocRM));
                    treenode.BackColor = item.GetColorByDirInfo(treenode.ForeColor);
                    start.Nodes.Add(treenode);

                    CopyVirtualBranch(treenode, item);
                }
            }
        }