Esempio n. 1
0
        public string GetOrCreateFileName()
        {
            _saveAsForm.ShowDialog();

            if (_saveAsForm.DialogResult == DialogResult.OK)
            {
                return(_saveAsForm.FileName);
            }

            return(null);
        }
        public bool Save(bool showQuery)
        {
            if (SqlSourceType == SourceType.New)
            {
                SaveAsForm dialog = new SaveAsForm(Text);
                switch (dialog.ShowDialog())
                {
                case DialogResult.Cancel:
                    return(false);

                case DialogResult.No:
                    return(true);
                }
                if (dialog.SaveAsFile)
                {
                    return(SaveInFile());
                }
                return(SaveAsNewUserQuery());
            }
            if (_oldSql != FormattedQueryText)
            {
                if (showQuery)
                {
                    SaveForm saveDialog = new SaveForm();
                    if (saveDialog.ShowDialog() != DialogResult.OK)
                    {
                        return(false);
                    }
                    if (saveDialog.IsSave)
                    {
                        return(SaveQuery());
                    }
                }
                else
                {
                    return(SaveQuery());
                }
            }
            return(true);
        }