Exemplo n.º 1
0
        private void mDeleteFileButton_Click(object sender, EventArgs e)
        {
            if (this.mInternalFilesListBox.SelectedIndex > -1)
            {
                String        fileToRemove = mInternalFilesListBox.Items[mInternalFilesListBox.SelectedIndex].ToString();
                PS2FileHelper helper       = new PS2FileHelper(mSaveFileNameTextBox.Text);
                string        targetFile   = "mySave.max";
                if (helper.DeleteFileFromSave(fileToRemove) && helper.SaveMaxFileAs(targetFile))
                {
                    mSaveFileNameTextBox.Text = targetFile;
                    ShowContants(mSaveFileNameTextBox.Text);
                }

                helper.Dispose();
            }
        }
Exemplo n.º 2
0
        private void mInternalFilesListBox_DragDrop(object sender, DragEventArgs e)
        {
            Control tb = sender as Control;

            string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
            if (files != null && files.Length == 1 && tb != null)
            {
                string        targetFile = ".\\mySave.max";
                PS2FileHelper helper     = new PS2FileHelper(mSaveFileNameTextBox.Text);
                helper.AddFileToSave(files[0]);
                helper.SaveMaxFileAs(targetFile);
                mSaveFileNameTextBox.Text = targetFile;
                ShowContants(mSaveFileNameTextBox.Text);
                helper.Dispose();
            }
        }
Exemplo n.º 3
0
        private void mAddFileButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                string        targetFile = "mySave.max";
                PS2FileHelper helper     = new PS2FileHelper(mSaveFileNameTextBox.Text);
                helper.AddFileToSave(dlg.FileName);
                helper.SaveMaxFileAs(targetFile);
                mSaveFileNameTextBox.Text = targetFile;
                ShowContants(mSaveFileNameTextBox.Text);
                helper.Dispose();
            }
            dlg.Dispose();
        }
Exemplo n.º 4
0
        private static string UnpackMaxToTempFolder(string maxFileName)
        {
            string dirName = Path.GetTempPath() + "NFL2K5ToolTmpPS2Unpack\\";

            if (Directory.Exists(dirName))
            {
                Directory.Delete(dirName, true);
            }
            Directory.CreateDirectory(dirName);

            PS2FileHelper helper = new PS2FileHelper(maxFileName);
            List <String> files  = helper.FilesInSave;

            foreach (string file in files)
            {
                helper.ExtractFile(file, dirName);
            }

            helper.Dispose();

            return(dirName);
        }