|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)
'Declaration <InterfaceTypeAttribute(1)> _ <GuidAttribute("DF29D855-D0EC-4DA1-BCC3-42FA3A09B1CB")> _ Public Interface IVsUIHierWinClipboardHelper 'Usage Dim instance As IVsUIHierWinClipboardHelper
/** @attribute InterfaceTypeAttribute(1) */ /** @attribute GuidAttribute("DF29D855-D0EC-4DA1-BCC3-42FA3A09B1CB") */ public interface IVsUIHierWinClipboardHelper
Any hierarchy that wishes to coordinate its clipboard operations with other hierarchies should implementand register to receive notification of clipboard events by calling .
The following is an example of a typical cut-and-paste sequence between hierarchies:
The user performs a cut of a project item from a project hierarchy.
The source project creates ancontaining the data in CF_VSPROJECTITEMS format (similar to the CF_HDROP format). In addition to passing the IDataObject to OLE, the source hierarchy also passes it to the environment via the method.
The source project changes the appearance of the cut item by callingand specifying a value of either or , as appropriate.
The user performs a paste of the project item.
The destination project handles the contents of the IDataObject, and then communicates that a paste occurred by calling.
When its Paste method is called, the IVsUIHierWinClipboardHelper interface iterates through the list of hierarchies that have called AdviseClipboardHelperEvents and callson each. When the source project is called in this way, it should complete the cut by deleting the cut item from its hierarchy.
The IVsUIHierWinClipboardHelper interface is also a clipboard watcher, so when the contents of the clipboard change, and the cut IDataObject is no longer on the clipboard, themethod of each listener is called. This way, the cut item can be undimmed by calling ExpandItem and specifying a value of . In a copy situation, the item need not be dimmed since it has not been cut.
See illustrations of the implementation and/or calling of this interface in the sampleNotes to Implementers Implemented by the environment. Notes to Callers Called by hierarchies that support cut, copy, and paste operations. .