コード例 #1
0
        private void Button7_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog.Description = "Select folder to export all Abilities to:";
            if (FolderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                Text                = "Please wait...";
                UseWaitCursor       = true;
                ProgressBar.Value   = 0;
                ProgressBar.Visible = true;
                if (System.IO.Directory.Exists(FolderBrowserDialog.SelectedPath + @"\Abilities") == false)
                {
                    System.IO.Directory.CreateDirectory(FolderBrowserDialog.SelectedPath + @"\Abilities");
                }

                int LoopVar;
                LoopVar = 0;
                while (LoopVar < Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfAbilities", "")) - 1d == true)
                {
                    LoopVar += 1;
                    AbilityList.SelectedIndex = LoopVar;
                    Refresh();
                    Enabled = false;
                    ExportDataFunctions.ExportAbilityINI(FolderBrowserDialog.SelectedPath + @"\Abilities\" + LoopVar + ".ini", LoopVar);
                    ProgressBar.Value = (int)(LoopVar / Conversions.ToDouble(Ini.GetString(Conversions.ToString(MMainFunctions.GetIniFileLocation()), MainObject.Header, "NumberOfAbilities", "")) * 100d);
                }

                Text                = "Ability Editor";
                UseWaitCursor       = false;
                Enabled             = true;
                ProgressBar.Visible = false;
                BringToFront();
            }
        }
コード例 #2
0
        private void Button5_Click(object sender, EventArgs e)
        {
            SaveFileDialog.FileName = AbilityList.SelectedIndex + ".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.ExportAbilityINI(SaveFileDialog.FileName, AbilityList.SelectedIndex);
            }
        }