private void BoxSqlCurrentSubQuery_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
        {
            if (QueryView.ActiveUnionSubQuery == null)
            {
                return;
            }
            try
            {
                ErrorBoxCurrentSunQuery.Show(null, SqlContext.SyntaxProvider);

                QView.ActiveUnionSubQuery.ParentSubQuery.SQL = ((SqlTextEditor)sender).Text;

                var sql = QueryView.ActiveUnionSubQuery.ParentSubQuery.GetResultSQL(SqlFormattingOptions);

                _transformerSql.Query = new SQLQuery(QueryView.ActiveUnionSubQuery.SQLContext)
                {
                    SQL = sql
                };
            }
            catch (SQLParsingException ex)
            {
                ErrorBoxCurrentSunQuery.Show(ex.Message, SqlContext.SyntaxProvider);
                _errorPositionCurrentSubQuery = ex.ErrorPos.pos;
            }
        }
        private void SetSqlTextCurrentSubQuery()
        {
            ErrorBoxCurrentSunQuery.Show(null, QView.Query.SQLContext.SyntaxProvider);
            if (_transformerSql == null)
            {
                return;
            }

            if (QueryView.ActiveUnionSubQuery == null || SqlQuery.SleepMode)
            {
                BoxSqlCurrentSubQuery.Text = string.Empty;
                _transformerSql.Query      = null;
                return;
            }


            var sqlForDataPreview = QueryView.ActiveUnionSubQuery.ParentSubQuery.GetSqlForDataPreview();

            _transformerSql.Query = new SQLQuery(QueryView.ActiveUnionSubQuery.SQLContext)
            {
                SQL = sqlForDataPreview
            };

            var sql = QueryView.ActiveUnionSubQuery.ParentSubQuery.GetResultSQL(SqlFormattingOptions);

            BoxSqlCurrentSubQuery.Text   = sql;
            _lastValidSqlCurrentSubQuery = sql;
        }