public void Dispose() { Win32Operations.RemoveClipboardFormatListener(m_monitor.Handle); m_monitor = null; _SetState(PasteToTargetState.Inactive); }
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); }