Beispiel #1
0
 public void AddDir(string path, string newName, TreeNode root)
 {
     if (path.StartsWith("ARCHIVE"))
     {
         int num = (int)MessageBox.Show("Manipulation of archives not supported", "Sorry,");
     }
     else
     {
         ushort dirIdFromName = this.GetDirIDFromName(path.TrimEnd('/'));
         Array.Resize <NitroROM.DirEntry>(ref this.m_DirEntries, this.m_DirEntries.Length + 1);
         NitroROM.DirEntry dirEntry;
         dirEntry.ID       = (ushort)(this.m_DirEntries.Length - 1 + 61440);
         dirEntry.ParentID = dirIdFromName;
         dirEntry.Name     = newName;
         dirEntry.FullName = path + newName;
         this.m_DirEntries[this.m_DirEntries.Length - 1] = dirEntry;
         TreeNode treeNode = ROMFileSelect.GetFileOrDir(path.TrimEnd('/'), root).Nodes.Add(newName, newName);
         treeNode.Tag = (object)(path + newName + "/");
         treeNode.EnsureVisible();
         treeNode.TreeView.SelectedNode = treeNode;
     }
 }
Beispiel #2
0
        public void RemoveFile(string filename, TreeNode root)
        {
            int fileIdFromName = (int)this.GetFileIDFromName(filename);

            if (fileIdFromName == (int)ushort.MaxValue)
            {
                int num1 = (int)MessageBox.Show("This is a bug and shouldn't happen.", "Sorry,");
            }
            else if (fileIdFromName >= 32768)
            {
                int num2 = (int)MessageBox.Show("Manipulation of archives not supported", "Sorry,");
            }
            else
            {
                this.AllowEmptySpaceInOv0();
                this.RemoveFileEntriesAndCorrectIDs(new List <int>()
                {
                    fileIdFromName
                });
                ROMFileSelect.GetFileOrDir(filename, root).Remove();
            }
        }