private void Button9_Click(object sender, EventArgs e) { FolderBrowserDialog.Description = "Select folder to export all Attacks to:"; if (FolderBrowserDialog.ShowDialog() == DialogResult.OK) { Text = "Please wait..."; UseWaitCursor = true; ProgressBar.Value = 0; ProgressBar.Visible = true; if (System.IO.Directory.Exists(FolderBrowserDialog.SelectedPath + @"\Attacks") == false) { System.IO.Directory.CreateDirectory(FolderBrowserDialog.SelectedPath + @"\Attacks"); } int LoopVar; LoopVar = 0; while (LoopVar < Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfAttacks", "")) == true) { ComboBox3.SelectedIndex = LoopVar; LoopVar = LoopVar + 1; Refresh(); Enabled = false; ExportDataFunctions.ExportAttackINI(FolderBrowserDialog.SelectedPath + @"\Attacks\" + LoopVar + ".ini", LoopVar); ProgressBar.Value = (int)(LoopVar / Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfAttacks", "")) * 100d); } Text = "Attack Editor"; UseWaitCursor = false; Enabled = true; ProgressBar.Visible = false; BringToFront(); } }
private void Button10_Click(object sender, EventArgs e) { SaveFileDialog.FileName = ComboBox3.SelectedIndex + 1 + ".ini"; // SaveFileDialog.CheckFileExists = True // Check to ensure that the selected path exists. Dialog box displays // a warning otherwise. SaveFileDialog.CheckPathExists = true; // Get or set default extension. Doesn't include the leading ".". SaveFileDialog.DefaultExt = "ini"; // Return the file referenced by a link? If False, simply returns the selected link // file. If True, returns the file linked to the LNK file. SaveFileDialog.DereferenceLinks = true; // Just as in VB6, use a set of pairs of filters, separated with "|". Each // pair consists of a description|file spec. Use a "|" between pairs. No need to put a // trailing "|". You can set the FilterIndex property as well, to select the default // filter. The first filter is numbered 1 (not 0). The default is 1. SaveFileDialog.Filter = "(*.ini)|*.ini*"; // SaveFileDialog.Multiselect = False // Restore the original directory when done selecting // a file? If False, the current directory changes // to the directory in which you selected the file. // Set this to True to put the current folder back // where it was when you started. // The default is False. // .RestoreDirectory = False // Show the Help button and Read-Only checkbox? SaveFileDialog.ShowHelp = false; // SaveFileDialog.ShowReadOnly = False // Start out with the read-only check box checked? // This only make sense if ShowReadOnly is True. // SaveFileDialog.ReadOnlyChecked = False SaveFileDialog.Title = "Save as"; // Only accept valid Win32 file names? SaveFileDialog.ValidateNames = true; if (SaveFileDialog.ShowDialog() == DialogResult.OK) { ExportDataFunctions.ExportAttackINI(SaveFileDialog.FileName, ComboBox3.SelectedIndex + 1); } }