Exemplo n.º 1
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData.ToString() == "F5")
            {
                ExecuteSql();
            }
            else if (keyData.ToString() == "F2")
            {
                SODatabase db      = base.MainForm.GetCurrentDatabase();
                string     cmdText = textEditorControl1.Text;
                if (this.CurrentDatabase != db)
                {
                    this.CurrentDatabase = db;
                }
                string conStr = string.Format("{0}database={1};", CurrentDatabase.Database.Parent.DbProvider.ConnectionString, CurrentDatabase.Database.FullName);
                string classT = new Class.ClassGenerating().SqlToClass(conStr, cmdText, "Test");
                Clipboard.SetDataObject(classT);
            }

            return(base.ProcessCmdKey(ref msg, keyData));
        }
Exemplo n.º 2
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData.ToString() == "F5")
            {
                ExecuteSql();
            }
            else if (keyData.ToString() == "F2")
            {
                SODatabase db = base.MainForm.GetCurrentDatabase();
                string cmdText = textEditorControl1.Text;
                if (this.CurrentDatabase != db) this.CurrentDatabase = db;
                string conStr = string.Format("{0}database={1};", CurrentDatabase.Database.Parent.DbProvider.ConnectionString, CurrentDatabase.Database.FullName);
                string classT = new Class.ClassGenerating().SqlToClass(conStr, cmdText, "Test");
                Clipboard.SetDataObject(classT);

            }

            return base.ProcessCmdKey(ref msg, keyData);
        }