FlickrSync.Preferences.buttonOK_Click C# (CSharp) Method

buttonOK_Click() private method

private buttonOK_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if ((FlickrSync.LogLevel)comboBoxLogLevel.SelectedIndex == FlickrSync.LogLevel.LogNone &&
                (FlickrSync.MessagesLevel)comboBoxMsgLevel.SelectedIndex == FlickrSync.MessagesLevel.MessagesNone)
            {
                if (MessageBox.Show("It is highly recommended that you keep some type of information, either on application messages or on a log file. Are you sure you want to disable both?", "Confirmation", MessageBoxButtons.YesNoCancel) != DialogResult.Yes)
                    return;
            }

            Properties.Settings.Default.Method = ((SyncFolder.Methods)comboBoxMethod.SelectedIndex).ToString();
            Properties.Settings.Default.OrderType = ((SyncFolder.OrderTypes)comboBoxOrderType.SelectedIndex).ToString();
            Properties.Settings.Default.NoDelete = checkBoxNoDelete.Checked;
            Properties.Settings.Default.NoDeleteTags = checkBoxNoDeleteTags.Checked;
            Properties.Settings.Default.UseThumbnailImages = this.checkBoxShowThumbnailImages.Checked;
            Properties.Settings.Default.ProxyUse = checkBoxUseProxy.Checked;
            Properties.Settings.Default.ProxyHost = textBoxProxyHost.Text;
            Properties.Settings.Default.ProxyPort = textBoxProxyPort.Text;
            Properties.Settings.Default.ProxyUser = textBoxProxyUser.Text;
            Properties.Settings.Default.ProxyPass = textBoxProxyPass.Text;
            Properties.Settings.Default.MessageLevel = ((FlickrSync.MessagesLevel)comboBoxMsgLevel.SelectedIndex).ToString();
            Properties.Settings.Default.LogLevel = ((FlickrSync.LogLevel)comboBoxLogLevel.SelectedIndex).ToString();
            Properties.Settings.Default.LogFile = labelLogFile.Text;
            Properties.Settings.Default.Save();

            this.DialogResult = DialogResult.OK;
            this.Close();
        }