コード例 #1
0
        /// <summary>
        /// Parses the SQL code in the RTF Box and replaces it maintaining the current selection / cursor position
        /// </summary>
        public void ReplaceRtf(Parser i_Parser, bool b_ModifyLinebreaks)
        {
            int s32_CursorPos = this.SelectionStart;
            int s32_SelLen    = this.SelectionLength;

            // ParseText() stores ms32_CursorPos in the linked chain
            // and FillRtfBuilder() sets ms32_CursorPos to the new position
            if (!i_Parser.Parse(this.Text, b_ModifyLinebreaks, true, ref s32_CursorPos))
                return; // Aborted

            // replace RTF flickerless
            ReplaceRtf(i_Parser.GetRtf(this.Font), s32_CursorPos, s32_SelLen);
        }
コード例 #2
0
ファイル: frmEditor.cs プロジェクト: dstrucl/Tangenta40
        private void tsmi_Params_Insert_PRINT_parameters_command_at_the_top_of_the_text_Click(object sender, EventArgs e)
        {
            Parser i_Parser = new Parser();

            string sql = s_sql_print + "\n" + ms_sql;

            ms_sql = sql;

            i_Parser.Parse(ms_sql, true, true);

            rtfBox.Rtf = i_Parser.GetRtf(rtfBox.Font);
        }
コード例 #3
0
ファイル: frmEditor.cs プロジェクト: dstrucl/Tangenta40
        protected override void OnLoadDelayed()
        {
            //if (m_lSQL_Parameter != null)
            //{
            //    if (m_lSQL_Parameter.Count > 0)
            //    {
            //        foreach (Log_SQL_Parameter sqlpar in m_lSQL_Parameter)
            //        {
            //            this.tsmi_Params_ComboBox.Items.Add(sqlpar.Name + " DBType=" + sqlpar.dbType.ToString() + " Value = ");//+ CodeTables.Func.sqlpar.Value
            //        }
            //    }
            //}
            rtfBox.ReadOnly = true;
            this.Cursor = Cursors.WaitCursor;

            Parser i_Parser = new Parser();
            if (ms_File != null)
            {
                i_Parser.Parse(Functions.ReadFileIntoString(this, ms_File), true, true);
            }
            else
            {
                i_Parser.Parse(ms_sql, true, true);
            }

            rtfBox.Rtf = i_Parser.GetRtf(rtfBox.Font);

            this.Cursor = Cursors.Arrow;
            rtfBox.ReadOnly = false;
            rtfBox.TextModified = false;
            rtfBox.StatusBar = lblStatus;
        }