示例#1
0
        private void toolStripButtonSave_Click(object sender, EventArgs e)
        {
            string explorepath = Path.Combine(Tools.GetAppDataDirectory(), "Exploration");

            if (!Directory.Exists(explorepath))
            {
                Directory.CreateDirectory(explorepath);
            }

            UpdateExplorationInfo(_currentExplorationSet);

            if (String.IsNullOrEmpty(textBoxFileName.Text))
            {
                SaveFileDialog dlg = new SaveFileDialog();

                dlg.InitialDirectory = explorepath;
                dlg.OverwritePrompt  = true;
                dlg.DefaultExt       = "json";
                dlg.AddExtension     = true;
                dlg.Filter           = "Explore file| *.json";

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    textBoxFileName.Text = dlg.FileName;
                }
                else
                {
                    return;
                }
            }
            UpdateExplorationInfo(_currentExplorationSet);
            _currentExplorationSet.Save(textBoxFileName.Text);
        }
        private void toolStripButtonSave_Click(object sender, EventArgs e)
        {
            UpdateExplorationInfo(currentexplorationset);

            if (String.IsNullOrEmpty(textBoxFileName.Text))
            {
                string file = currentexplorationset.DialogSave(FindForm());

                if (file != null)
                {
                    textBoxFileName.Text = file;
                }
            }
            else
            {
                currentexplorationset.Save(textBoxFileName.Text);
                ExtendedControls.MessageBoxTheme.Show(this.FindForm(), string.Format("Saved to {0} Exploration Set".T(EDTx.UserControlExploration_Saved), textBoxFileName.Text));
            }
        }