public void QueryScriptInsertCommandHandler(object sender, ExecutedRoutedEventArgs e) { e.Handled = true; object dbo = this.ActiveDBObject(); if (dbo is ITabularObjectBase) { QueryDocument qd = GetQueryEditor(); qd.ScriptInsert((ITabularObjectBase)dbo); } }