public PasteToTargetOperation(Win32ClipboardMonitor monitor, DTE dte, IVsTextView targetEditor, EnvDTE.Window targetWindow)
        {
            m_monitor = monitor;
            Win32Operations.AddClipboardFormatListener(m_monitor.Handle);
            m_monitor.ClipboardChanged += monitor_ClipboardChanged;

            m_dte          = dte;
            m_targetEditor = targetEditor;
            m_targetWindow = targetWindow;

            m_targetHost         = VSHelpers.GetViewHost(m_targetEditor);
            m_targetHost.Closed += targetHost_Closed;

            SelectionState = TextSelectionState.Save(m_targetHost.TextView.Selection, m_targetHost.TextView.Caret);

            _SetState(PasteToTargetState.CaptureMode);
        }
        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);
        }