public PasteToTargetOperation StartOperation(DTE dte, IVsTextView targetEditor, EnvDTE.Window targetWindow)
        {
            if (Operation != null)
            {
                Operation.Dispose();
                Operation = null;
            }

            if (OperationUI != null)
            {
                OperationUI.Dispose();
                OperationUI = null;
            }

            Operation   = new PasteToTargetOperation(m_monitor, dte, targetEditor, targetWindow);
            OperationUI = new PasteToTargetOperationUI(Operation, VSHelpers.GetViewHost(targetEditor));
            return(Operation);
        }
        public PasteToTargetOperationUI(PasteToTargetOperation op, IWpfTextViewHost targetHost)
        {
            _op = op;
            _op.StateChanged += _op_StateChanged;

            m_targetHost = targetHost;

            m_adornment         = new PasteToTargetStatusAdornment(m_targetHost.TextView);
            m_adornment.Cancel += adornment_Cancel;

            m_highlightTarget = m_targetHost.TextView.Properties.GetOrCreateSingletonProperty <PasteToTargetHighlight>(delegate
            {
                throw new Exception("Unexpected: ITagger PasteToTargetHighlight was not created");
            });
            m_highlightTarget.FireTagsChanged(
                PasteToTargetState.CaptureMode,
                _op.SelectionState.GetSelectedSpans(m_targetHost.TextView.TextBuffer.CurrentSnapshot));
        }