private void MapDirectory(DirectoryInfo directory, TreeNode node)
 {
     foreach (FileSystemInfo fileSystemInfo in directory.GetFileSystemInfos())
     {
         if (fileSystemInfo is DirectoryInfo)
         {
             DirectoryInfo       directory1          = (DirectoryInfo)fileSystemInfo;
             ScriptDirectoryNode scriptDirectoryNode = new ScriptDirectoryNode(directory1.Name);
             scriptDirectoryNode.ContextMenuStrip = this.ctxDirectoryNode;
             node.Nodes.Add((TreeNode)scriptDirectoryNode);
             this.MapDirectory(directory1, (TreeNode)scriptDirectoryNode);
         }
         if (fileSystemInfo is FileInfo)
         {
             FileInfo fileInfo = (FileInfo)fileSystemInfo;
             if (fileInfo.Extension != ".settings")
             {
                 ScriptFileNode scriptFileNode = new ScriptFileNode(fileInfo.Name);
                 scriptFileNode.File             = fileSystemInfo as FileInfo;
                 scriptFileNode.ContextMenuStrip = this.ctxFileNode;
                 node.Nodes.Add((TreeNode)scriptFileNode);
             }
         }
     }
 }
 private void watcher_Renamed(object sender, RenamedEventArgs e)
 {
     if (this.InvokeRequired)
     {
         this.Invoke((Delegate) new RenamedEventHandler(this.watcher_Renamed), sender, (object)e);
     }
     else
     {
         FileSystemEntryNode entryNode = this.FindEntryNode(e.OldName);
         if (entryNode == null)
         {
             return;
         }
         ScriptFileNode[] scriptFileNodeArray = (ScriptFileNode[])null;
         if (entryNode is ScriptDirectoryNode)
         {
             scriptFileNodeArray = this.GetFileSubNodes((ScriptDirectoryNode)entryNode);
         }
         if (entryNode is ScriptFileNode)
         {
             scriptFileNodeArray = new ScriptFileNode[1]
             {
                 (ScriptFileNode)entryNode
             }
         }
         ;
         foreach (TreeNode node in scriptFileNodeArray)
         {
             Global.EditorManager.Close(this.GetFullPath(node));
         }
         List <string> list = new List <string>((IEnumerable <string>) this.SplitName(e.Name));
         entryNode.RenameTo(Enumerable.Last <string>((IEnumerable <string>)list));
         this.treeView.Sort();
     }
 }
Beispiel #3
0
 private void MapDirectory(DirectoryInfo directory, TreeNode node)
 {
   foreach (FileSystemInfo fileSystemInfo in directory.GetFileSystemInfos())
   {
     if (fileSystemInfo is DirectoryInfo)
     {
       DirectoryInfo directory1 = (DirectoryInfo) fileSystemInfo;
       ScriptDirectoryNode scriptDirectoryNode = new ScriptDirectoryNode(directory1.Name);
       scriptDirectoryNode.ContextMenuStrip = this.ctxDirectoryNode;
       node.Nodes.Add((TreeNode) scriptDirectoryNode);
       this.MapDirectory(directory1, (TreeNode) scriptDirectoryNode);
     }
     if (fileSystemInfo is FileInfo)
     {
       FileInfo fileInfo = (FileInfo) fileSystemInfo;
       if (fileInfo.Extension != ".settings")
       {
         ScriptFileNode scriptFileNode = new ScriptFileNode(fileInfo.Name);
         scriptFileNode.File = fileSystemInfo as FileInfo;
         scriptFileNode.ContextMenuStrip = this.ctxFileNode;
         node.Nodes.Add((TreeNode) scriptFileNode);
       }
     }
   }
 }
Beispiel #4
0
 private void watcher_Renamed(object sender, RenamedEventArgs e)
 {
   if (this.InvokeRequired)
   {
     this.Invoke((Delegate) new RenamedEventHandler(this.watcher_Renamed), sender, (object) e);
   }
   else
   {
     FileSystemEntryNode entryNode = this.FindEntryNode(e.OldName);
     if (entryNode == null)
       return;
     ScriptFileNode[] scriptFileNodeArray = (ScriptFileNode[]) null;
     if (entryNode is ScriptDirectoryNode)
       scriptFileNodeArray = this.GetFileSubNodes((ScriptDirectoryNode) entryNode);
     if (entryNode is ScriptFileNode)
       scriptFileNodeArray = new ScriptFileNode[1]
       {
         (ScriptFileNode) entryNode
       };
     foreach (TreeNode node in scriptFileNodeArray)
       Global.EditorManager.Close(this.GetFullPath(node));
     List<string> list = new List<string>((IEnumerable<string>) this.SplitName(e.Name));
     entryNode.RenameTo(Enumerable.Last<string>((IEnumerable<string>) list));
     this.treeView.Sort();
   }
 }