예제 #1
0
        //Calculate pie-slice sizes and orientations.
        public void CalculateDisk(FolderItem root)
        {
            float angle = root.StartAngle;
            float sweep = root.SweepAngle;
            int   level = root.Level;

            foreach (FolderItem child in root.Children)
            {
                child.PercentageOfParent = (float)child.TotalSize / (float)root.TotalSize;
                child.Level      = level + 1;
                child.StartAngle = Math.Abs(angle);
                child.SweepAngle = Math.Abs(child.PercentageOfParent * sweep);

                CalculateDisk(child);

                angle += child.SweepAngle;
            }

            if (root.SweepAngle > 0.001)
            {
                mapdepth = Math.Max(mapdepth, root.Level);
            }
        }
예제 #2
0
        public void OpenSelectedFolder()
        {
            FolderItem item = (FolderItem)treeView.SelectedNode.Tag;

            System.Diagnostics.Process.Start(item.FolderName);
        }