private void AddSubDirs(DirNode node) { for (int i = 0; i < node.Nodes.Count; i++) { AddDirs(node.Nodes[i]); } node.SubDirectoriesAdded = true; }
private void FillDirTree() { string[] drivers = Environment.GetLogicalDrives(); for (int i = 0; i < drivers.Length; i++) { Console.WriteLine("i={0}", i); if (PlatformInvokeKernel32.GetDriveType(drivers[i]) == PlatformInvokeKernel32.DRIVE_FIXED) { DirNode root = new DirNode(drivers[i]); treeViewDir.Nodes.Add(root); AddDirs(root); } } }