示例#1
0
        private bool Save(string fileName = null)
        {
            Cursor = Cursors.WaitCursor;
            try
            {
                if (!ValidateConnection() || !ValidateArchiveConnection() || !ValidateLanguages() || !ValidateConnectionForAvr())
                {
                    return(false);
                }

                SaveDbConnection();
                SaveArchiveConnection();
                SaveReportsServiceSettings();
                SaveWebSettings();
                SaveWebAdvancedSettings();
                SaveMiscellaneousSettings();

                if (fileName == null)
                {
                    m_config.Save(true, true);
                }
                else
                {
                    m_config.SaveAs(fileName, true, true);
                }
                return(true);
            }
            catch (Exception e)
            {
                MessageBox.Show(this, "Can't save configuration file: " + e.Message);
                return(false);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }