private void FormToFields(SqlQueryOptionsForm f)
        {
            this.TextSize = (int)(f.txtTextSize.Value);

            this.NoCount   = f.chkNoCount.Checked;
            this.NoExec    = f.chkNoExec.Checked;
            this.ParseOnly = f.chkParseOnly.Checked;
            this.Concat_Null_Yields_Null = f.chkConcatNullYieldsNull.Checked;
            this.ArithAbort     = f.chkArithAbort.Checked;
            this.ShowPlanText   = f.chkShowPlanText.Checked;
            this.StatisticsTime = f.chkStatisticsTime.Checked;
            this.StatisticsIo   = f.chkStatisticsIo.Checked;

            this.Transaction_Isolation_Level = f.cboTransactionIsolation.Text;
            this.Deadlock_Priority           = f.cboDeadlockPriority.Text;
            this.Lock_Timeout = (int)f.txtLockTimeout.Value;
            this.Query_Governor_Cost_Limit = (int)f.txtQueryGovernorCostLimit.Value;

            this.Quoted_Identifier      = f.chkQuotedIdentifier.Checked;
            this.Ansi_Null_Dflt_On      = f.chkAnsiNullDflt.Checked;
            this.Implicit_Transactions  = f.chkImplicitTransactions.Checked;
            this.Cursor_Close_On_Commit = f.chkCursorCloseOnCommit.Checked;
            this.Ansi_Padding           = f.chkAnsiPadding.Checked;
            this.Ansi_Warnings          = f.chkAnsiWarnings.Checked;
            this.Ansi_Nulls             = f.chkAnsiNulls.Checked;
        }
        private void FieldsToForm(SqlQueryOptionsForm f)
        {
            f.txtTextSize.Value = this.TextSize;

            f.chkNoCount.Checked              = this.NoCount;
            f.chkNoExec.Checked               = this.NoExec;
            f.chkParseOnly.Checked            = this.ParseOnly;
            f.chkConcatNullYieldsNull.Checked = this.Concat_Null_Yields_Null;
            f.chkArithAbort.Checked           = this.ArithAbort;
            f.chkShowPlanText.Checked         = this.ShowPlanText;
            f.chkStatisticsTime.Checked       = this.StatisticsTime;
            f.chkStatisticsIo.Checked         = this.StatisticsIo;

            f.cboTransactionIsolation.Text    = this.Transaction_Isolation_Level;
            f.cboDeadlockPriority.Text        = this.Deadlock_Priority;
            f.txtLockTimeout.Value            = this.Lock_Timeout;
            f.txtQueryGovernorCostLimit.Value = this.Query_Governor_Cost_Limit;

            f.chkQuotedIdentifier.Checked     = this.Quoted_Identifier;
            f.chkAnsiNullDflt.Checked         = this.Ansi_Null_Dflt_On;
            f.chkImplicitTransactions.Checked = this.Implicit_Transactions;
            f.chkCursorCloseOnCommit.Checked  = this.Cursor_Close_On_Commit;
            f.chkAnsiPadding.Checked          = this.Ansi_Padding;
            f.chkAnsiWarnings.Checked         = this.Ansi_Warnings;
            f.chkAnsiNulls.Checked            = this.Ansi_Nulls;
        }
        public override DialogResult ShowForm()
        {
            SqlQueryOptionsForm f = new SqlQueryOptionsForm();

            FieldsToForm(f);

            DialogResult res = ShowForm(f);

            if (res == DialogResult.OK)
            {
                FormToFields(f);
            }
            return(res);
        }