예제 #1
0
        private void replaceBinaryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count != 1)
            {
                return;
            }
            if (MessageBox.Show("Are you sure you want to delete this?", "WARNING", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }
            FATXFileEntry x      = ((FATXFileEntry)listView1.SelectedItems[0].Tag);
            string        locale = VariousFunctions.GetUserFileLocale("Save to where?", "", false);

            if (locale == null)
            {
                return;
            }
            listView1.Enabled = false;
            status            = "Replacing File";
            if (x.Replace(locale))
            {
                refresh();
            }
            status            = "Idle";
            listView1.Enabled = true;
        }
예제 #2
0
 private void extractToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     if (listView1.SelectedItems.Count == 1)
     {
         FATXFileEntry x = ((FATXFileEntry)listView1.SelectedItems[0].Tag);
         string        y = VariousFunctions.GetUserFileLocale("Save to where?", VariousFunctions.GetFilter(x.Name), x.Name, false);
         if (y == null)
         {
             return;
         }
         advTree1.Enabled = listView1.Enabled = menuStrip1.Enabled = false;
         x.Extract(y);
     }
     else
     {
         string y = VariousFunctions.GetUserFolderLocale("Save to where?");
         if (y == null)
         {
             return;
         }
         advTree1.Enabled = listView1.Enabled = menuStrip1.Enabled = false;
         foreach (ListViewItem z in listView1.SelectedItems)
         {
             FATXFileEntry x = ((FATXFileEntry)z.Tag);
             x.Extract(y + "/" + x.Name);
         }
     }
     advTree1.Enabled = listView1.Enabled = menuStrip1.Enabled = true;
 }
예제 #3
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to delete these?", "WARNING", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }
            listView1.Enabled = false;
            status            = "Deleting files";
            foreach (ListViewItem x in listView1.SelectedItems)
            {
                switch (x.ImageIndex)
                {
                case 2:
                {
                    FATXFileEntry y = (FATXFileEntry)x.Tag;
                    y.Delete();
                }
                break;

                default: continue;
                }
            }
            status = "Idle";
            refresh();
            listView1.Enabled = true;
        }
예제 #4
0
        void xWatch_Created(object sender, FileSystemEventArgs e)
        {
            string droppath = Directory.GetParent(e.FullPath).FullName;

            temp = null;
            menuStrip1.Enabled = menuStrip2.Enabled = listView1.Enabled = false;
            status             = "Extracting items";
            foreach (ListViewItem y in listView1.SelectedItems)
            {
                switch (y.ImageIndex)
                {
                case 1:
                {
                    FATXFolderEntry ent = (FATXFolderEntry)y.Tag;
                    ent.Extract(droppath, true);
                    break;
                }

                case 2:
                {
                    FATXFileEntry ent   = ((FATXFileEntry)y.Tag);
                    string        xfile = droppath + "/" + ent.Name;
                    ent.Extract(xfile);
                    break;
                }

                default: break;
                }
            }
            VariousFunctions.DeleteFile(e.FullPath);
            status             = "Idle";
            isitem             = false;
            menuStrip1.Enabled = menuStrip2.Enabled = listView1.Enabled = true;
        }
예제 #5
0
파일: FileProp.cs 프로젝트: randprint/X360
 public FileProp(FATXFileEntry xin, string stfsname)
 {
     InitializeComponent();
     xfile          = xin;
     textBoxX1.Text = xin.Name;
     textBoxX2.Text = stfsname;
     textBoxX3.Text = xin.Size.ToString() + " bytes";
 }
예제 #6
0
        ListViewItem GetItem(FATXFileEntry tag)
        {
            ListViewItem x = new ListViewItem(tag.Name);

            x.Tag = tag;
            x.SubItems.Add("");
            x.SubItems.Add(tag.Size.ToString());
            return(x);
        }
예제 #7
0
        private void injectRiskyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FATXFileEntry x = ((FATXFileEntry)listView1.SelectedItems[0].Tag);
            string        y = VariousFunctions.GetUserFileLocale("Open a file", VariousFunctions.GetFilter(x.Name), x.Name, true);

            if (y == null)
            {
                return;
            }
            advTree1.Enabled = listView1.Enabled = menuStrip1.Enabled = false;
            x.Inject(y);
            advTree1.Enabled = listView1.Enabled = menuStrip1.Enabled = true;
        }
예제 #8
0
        private void replaceToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FATXFileEntry x      = ((FATXFileEntry)listView1.SelectedItems[0].Tag);
            string        filter = VariousFunctions.GetFilter(x.Name);

            if (filter != "")
            {
                filter += "|All|*.*";
            }
            string y = VariousFunctions.GetUserFileLocale("Open a file", filter, x.Name, true);

            if (y == null)
            {
                return;
            }
            advTree1.Enabled = listView1.Enabled = menuStrip1.Enabled = false;
            x.Replace(y);
            advTree1.Enabled = listView1.Enabled = menuStrip1.Enabled = true;
        }
예제 #9
0
        private void extractToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count != 1)
            {
                return;
            }
            FATXFileEntry x      = ((FATXFileEntry)listView1.SelectedItems[0].Tag);
            string        locale = VariousFunctions.GetUserFileLocale("Save to where?", "", false);

            if (locale == null)
            {
                return;
            }
            listView1.Enabled = false;
            status            = "Injecting File";
            if (x.Extract(locale))
            {
                refresh();
            }
            status            = "Idle";
            listView1.Enabled = true;
        }
예제 #10
0
        private void renameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count != 1)
            {
                return;
            }
            Renamer x = new Renamer(listView1.SelectedItems[0].Text, false);

            if (x.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            listView1.Enabled = false;
            status            = "Renaming";
            FATXFileEntry y = ((FATXFileEntry)listView1.SelectedItems[0].Tag);

            y.Name = x.FileName;
            if (y.WriteEntry())
            {
                refresh();
            }
            listView1.Enabled = true;
            status            = "Idle";
        }
예제 #11
0
파일: DJsIO.cs 프로젝트: VictorOverX/X360
 /// <summary>
 /// Disposes the stream
 /// </summary>
 /// <returns></returns>
 public override bool Dispose()
 {
     this.Close();
     xEntry = null;
     return true;
 }
예제 #12
0
파일: DJsIO.cs 프로젝트: VictorOverX/X360
 /// <summary>
 /// File IO on a FATX drive
 /// </summary>
 /// <param name="Instance"></param>
 /// <param name="xBlocks"></param>
 /// <param name="BigEndian"></param>
 public FATXStreamIO(FATXFileEntry Instance, ref uint[] xBlocks, bool BigEndian)
 {
     xEntry = Instance;
     if (xDrive.xActive)
         throw IOExcepts.AccessError;
     xDrive.GetIO();
     blocks = xBlocks;
     accessed = true;
     xDrive.xActive = true;
     IsBigEndian = BigEndian;
     Position = 0;
 }
        public DJsIO(FATXFileEntry xIn, bool BigEndian)
        {
            IsBigEndian = BigEndian;
            //try
            {

                xThisData = DataType.FatXFile;

                Position = 0;
            }
        }