void OnEnterCanceling() { // move VS window into the foreground m_dte.MainWindow.Activate(); // move editor into the foreground m_targetWindow.Activate(); // restore selection & caret TextSelectionState.Restore(SelectionState, m_targetHost.TextView.Selection, m_targetHost.TextView.Caret); _SetState(PasteToTargetState.Inactive); }
void OnEnterPasting() { // get actual text string sourceText = Clipboard.GetText(); // move VS window into the foreground m_dte.MainWindow.Activate(); // move editor into the foreground m_targetWindow.Activate(); // restore selection & caret TextSelectionState.Restore(SelectionState, m_targetHost.TextView.Selection, m_targetHost.TextView.Caret); // Paste clipboard m_dte.ExecuteCommand("Edit.Paste"); _SetState(PasteToTargetState.Inactive); }