Exemple #1
0
        public QueryEditorView()
        {
            InitializeComponent();

            _suggestionView = new SuggestionView(QueryTextBox)
            {
                DefaultSelectedIndex = 0
            };

            ViewerForm.Theme.ApplyTo(EditorToolStrip);

            // initialize highlighting
            QueryTextBox.StyleResetDefault();
            QueryTextBox.Styles[Style.Default].Font = "Consolas";
            QueryTextBox.Styles[Style.Default].Size = 11;
            QueryTextBox.StyleClearAll();

            QueryTextBox.Styles[Style.LineNumber].ForeColor = Color.FromArgb(0x888888);
            QueryTextBox.Styles[Style.LineNumber].BackColor = Color.White;

            QueryTextBox.Styles[Style.Sql.String].ForeColor   = Color.FromArgb(0xa31515);
            QueryTextBox.Styles[Style.Sql.Word].ForeColor     = Color.FromArgb(0x0000ff);
            QueryTextBox.Styles[Style.Sql.Operator].ForeColor = Color.FromArgb(0x444444);
            QueryTextBox.Styles[Style.Sql.Number].ForeColor   = Color.FromArgb(0x09885a);

            QueryTextBox.Lexer = Lexer.Sql;
            QueryTextBox.SetKeywords(0, "select where order group by desc asc and or not union except intersect");

            QueryTextBox.Margins[0].Type  = MarginType.Number;
            QueryTextBox.Margins[0].Width = 20;

            QueryTextBox.ClearCmdKey(Keys.Control | Keys.S);
            QueryTextBox.ClearCmdKey(Keys.Control | Keys.O);
        }