Coordinates clipboard operations between hierarchies in a UI hierarchy window.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Thetype exposes the following members.
|AdviseClipboardHelperEvents||Establishes client notification of hierarchy clipboard helper events without the hierarchy implementing IConnectionPointContainer.|
|Copy||Copies a data object from a hierarchy to the clipboard.|
|Cut||Cuts a data object from a hierarchy to the clipboard.|
|Paste||Pastes a data object from the clipboard to the hierarchy.|
|UnadviseClipboardHelperEvents||Disables client notification of hierarchy clipboard helper events without requiring that the hierarchy implement IConnectionPointContainer.|
Any hierarchy that wishes to coordinate its clipboard operations with other hierarchies should implement IVsUIHierWinClipboardHelperEvents and register to receive notification of clipboard events by calling AdviseClipboardHelperEvents.
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 an IDataObject containing 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 Cut method.
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 Paste.
When its Paste method is called, the IVsUIHierWinClipboardHelper interface iterates through the list of hierarchies that have called AdviseClipboardHelperEvents and calls OnPaste on each. When the source project is called in this way, it should complete the cut by deleting the cut item from its hierarchy.
The interface is also a clipboard watcher, so when the contents of the clipboard change, and the cut IDataObject is no longer on the clipboard, the OnClear method of each listener is called. This way, the cut item can be undimmed by calling ExpandItem and specifying a value of EXPF_UnCutHighlightItem. 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 sample Basic Project.Notes to Implementers
Implemented by the environment.Notes to Callers
Called by hierarchies that support cut, copy, and paste operations.