コード例 #1
0
 private static void OpenItem(ChangedFolder folder)
 {
     if (Directory.Exists(folder.Path))
     {
         Shell.StartFolder(folder.Path);
     }
     else
     {
         Shell.OpenFolderAndSelectItem(folder.Path);
     }
 }
コード例 #2
0
        private ChangedFolder CreateNode(string path)
        {
            var oldTopNode = treeView.TopNode;
            var name       = Path.GetFileName(path);

            if (path.Equals(rootFolder, StringComparison.CurrentCultureIgnoreCase))
            {
                name = path;
            }
            var folder = new ChangedFolder(path, new TreeNode(name));

            nodes[path.ToLower()] = folder;
            folder.Node.ExpandAll();
            folder.Node.SelectedImageIndex = folder.Node.ImageIndex = icons.GetIcon(path);
            treeView.TopNode = oldTopNode;
            return(folder);
        }