Exemplo n.º 1
0
        private void ConvertToSqlOm(RendererType rendererType)
        {
            ctrlSqlOm.Clear();
            ctrlSqlOmToSql.Clear();
            if (string.IsNullOrEmpty(ctrlSql.Text))
            {
                return;
            }

            string sqlOmText      = string.Empty;
            string sqlOmToSqlText = string.Empty;

            Cursor = Cursors.WaitCursor;

            try {
                _Engine = new SqlOMEngine();
                _Engine.ParseSQL(rendererType, ctrlSql.Text);

                sqlOmText      = _Engine.GetGeneratedSqlOm();
                sqlOmToSqlText = _Engine.GetGeneratedSql();
            }
            catch (Exception ex) {
                sqlOmText = ex.ToString();
                ctrlSqlOmToSql.Clear();
            }
            finally {
                ctrlSqlOm.AppendText(sqlOmText);
                ctrlSqlOmToSql.AppendText(sqlOmToSqlText);

                CsDrawer.DrawKnownColors(ctrlSqlOm);
                SQLDrawer.DrawKnownColors(ctrlSqlOmToSql);

                ctrlSqlOm.Select(0, 0);
                ctrlSqlOm.ScrollToCaret();

                ValidateGeneratedSql(rendererType);

                Cursor = Cursors.Default;
            }
        }
Exemplo n.º 2
0
 private void CtrlSql_TextChanged(object sender, EventArgs e)
 {
     SQLDrawer.DrawKnownColors(ctrlSql);
 }