/// <summary>Execute the command.</summary>
        public override void Execute()
        {
            IQueryEditor    editor    = ActiveFormAsSqlQueryEditor;
            string          tableName = HostWindow.DatabaseInspector.RightClickedTableName;
            DbModelInstance model     = HostWindow.DatabaseInspector.DbSchema;

            if (tableName != null && editor != null)
            {
                StringWriter sql = new StringWriter();
                SqlWriter.WriteUpdate(sql, GetTableOrViewByName(model, tableName));
                editor.InsertText(sql.ToString());
            }
        }
Beispiel #2
0
        /// <summary>The set text.</summary>
        /// <param name="text">The text.</param>
        private void SetText(string text)
        {
            IQueryEditor editor = _hostWindow.ActiveChildForm as IQueryEditor;

            if (editor != null)
            {
                editor.InsertText(text);
            }
            else
            {
                SystemSounds.Beep.Play();
            }
        }