Beispiel #1
0
 protected FSNode(string name, FileTree tree, FSNodeDir parent = null)
 {
     m_name = name;
     m_tree = tree;
     if (parent != null)
     {
         Parent = parent;
     }
     else
     {
         m_parent = null;
     }
 }
 public void AddFileTree(FileTree tree, string rootName)
 {
     if (tree == null)
         return;
     tree.FilePic = m_fileImageIndex;
     tree.FolderPic = m_directoryImageIndex;
     m_fileTrees.Add(tree, rootName);
     m_treeNames.Add(rootName, tree);
     tree.TransferIntoTreeNodeCollection(m_trvFileTreeView, m_trvFileTreeView.Nodes, rootName, true, m_noVirtual, m_noLocal, m_colorLocalFiles, m_colorLocalDirectories);
     tree.NodeAdded += NodeAdded;
     tree.NodeFileIsVirtualChanged += NodeFileIsVirtualChanged;
     tree.NodeHasLocalChanged += NodeHasLocalChanged;
     tree.NodeRemoved += NodeRemoved;
 }
 static internal void ReleaseFileTrees()
 {
     LoggingManager.SendMessage("FileManager - Releasing file trees");
     if (s_attribTree != null)
     {
         s_attribTree.ShutDown();
     }
     s_attribTree = null;
     if (s_dataTree != null)
     {
         s_dataTree.ShutDown();
     }
     s_dataTree = null;
 }
 public void AddFileTree(FileTree tree, string rootName)
 {
     if (tree == null)
     {
         return;
     }
     tree.FilePic   = m_fileImageIndex;
     tree.FolderPic = m_directoryImageIndex;
     m_fileTrees.Add(tree, rootName);
     m_treeNames.Add(rootName, tree);
     tree.TransferIntoTreeNodeCollection(m_trvFileTreeView, m_trvFileTreeView.Nodes, rootName, true, m_noVirtual, m_noLocal, m_colorLocalFiles, m_colorLocalDirectories);
     tree.NodeAdded += NodeAdded;
     tree.NodeFileIsVirtualChanged += NodeFileIsVirtualChanged;
     tree.NodeHasLocalChanged      += NodeHasLocalChanged;
     tree.NodeRemoved += NodeRemoved;
 }
Beispiel #5
0
 public void RemoveSelf(bool forceLocal = false)
 {
     if (forceLocal)
     {
         if (m_parent != null)
         {
             m_parent.RemoveChildIntern(this, true);
             m_parent = null;
             m_tree   = null;
         }
     }
     else
     {
         Parent = null;
     }
     ResetPath();
 }
Beispiel #6
0
        public FSNodeDir(string path, FileTree tree)
            : base(path.SubstringAfterLast('\\'), tree)
        {
            if (!Directory.Exists(path))
                Directory.CreateDirectory(path);
            IEnumerable<string> files = Directory.EnumerateFiles(path);
            IEnumerable<string> dirs = Directory.EnumerateDirectories(path);

            foreach (string file in files)
            {
                new FSNodeFile(file.SubstringAfterLast('\\'), m_tree, this);
            }

            foreach (string dir in dirs)
            {
                new FSNodeDir(dir, this);
            }
        }
        public FSNodeDir(string path, FileTree tree)
            : base(path.SubstringAfterLast('\\'), tree)
        {
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            IEnumerable <string> files = Directory.EnumerateFiles(path);
            IEnumerable <string> dirs  = Directory.EnumerateDirectories(path);

            foreach (string file in files)
            {
                new FSNodeFile(file.SubstringAfterLast('\\'), m_tree, this);
            }

            foreach (string dir in dirs)
            {
                new FSNodeDir(dir, this);
            }
        }
        static internal void FillTrees()
        {
            LoggingManager.SendMessage("FileManager - Filling file trees");
            DateTime t1 = DateTime.Now;

            if (ModManager.ModDataArchives != null)
            {
                s_dataTree = new FileTree(ModManager.ModDataDirectory, ModManager.ModDataArchives, "data");
            }
            if (ModManager.ModAttribArchives != null)
            {
                s_attribTree = new FileTree(ModManager.ModAttribDirectory, ModManager.ModAttribArchives, "attrib");
            }
            DateTime t2 = DateTime.Now;

            LoggingManager.SendMessage("FileManager - File trees filled in" + (t2 - t1).TotalSeconds + " seconds");
            if (FileTreesChanged != null)
            {
                FileTreesChanged();
            }
        }
 private FSNodeVirtualFile(string name, FileTree tree)
     : base(name, tree)
 {
 }
Beispiel #10
0
 public FSNodeDir(string name, FileTree tree, FSNodeDir parent = null)
     : base(name)
 {
     m_tree = tree;
     Parent = parent;
 }
 public FSNodeVirtualFile(string name, SGAStoredFile sgasf, FileTree tree, FSNodeDir parent = null)
     : base(name, tree, parent)
 {
     m_virtual = sgasf;
 }
Beispiel #12
0
 static internal void FillTrees()
 {
     LoggingManager.SendMessage("FileManager - Filling file trees");
     DateTime t1 = DateTime.Now;
     if (ModManager.ModDataArchives != null)
         s_dataTree = new FileTree(ModManager.ModDataDirectory, ModManager.ModDataArchives, "data");
     if (ModManager.ModAttribArchives != null)
         s_attribTree = new FileTree(ModManager.ModAttribDirectory, ModManager.ModAttribArchives, "attrib");
     DateTime t2 = DateTime.Now;
     LoggingManager.SendMessage("FileManager - File trees filled in" + (t2 - t1).TotalSeconds + " seconds");
     if (FileTreesChanged != null)
         FileTreesChanged();
 }
Beispiel #13
0
 public FSNodeFile(string name, FileTree tree, FSNodeDir parent = null)
     : base(name, tree, parent)
 {
 }
Beispiel #14
0
 static internal void ReleaseFileTrees()
 {
     LoggingManager.SendMessage("FileManager - Releasing file trees");
     if (s_attribTree != null)
         s_attribTree.ShutDown();
     s_attribTree = null;
     if (s_dataTree != null)
         s_dataTree.ShutDown();
     s_dataTree = null;
 }
Beispiel #15
0
 public FSNodeDir(string name, FileTree tree, FSNodeDir parent = null)
     : base(name)
 {
     m_tree = tree;
     Parent = parent;
 }
 public FSNodeVirtualFile(string name, SGAStoredFile sgasf, FileTree tree, FSNodeDir parent = null)
     : base(name, tree, parent)
 {
     m_virtual = sgasf;
 }
 private FSNodeVirtualFile(string name, FileTree tree)
     : base(name, tree)
 {
 }
 public FSNodeFile(string name, FileTree tree, FSNodeDir parent = null)
     : base(name, tree, parent)
 {
 }