Udostępnij za pośrednictwem


IVsUIHierWinClipboardHelper Interface

Definition

Coordinates clipboard operations between hierarchies in a UI hierarchy window.

public interface class IVsUIHierWinClipboardHelper
public interface class IVsUIHierWinClipboardHelper
__interface IVsUIHierWinClipboardHelper
[System.Runtime.InteropServices.Guid("DF29D855-D0EC-4DA1-BCC3-42FA3A09B1CB")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsUIHierWinClipboardHelper
[System.Runtime.InteropServices.Guid("DF29D855-D0EC-4DA1-BCC3-42FA3A09B1CB")]
[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsUIHierWinClipboardHelper
[<System.Runtime.InteropServices.Guid("DF29D855-D0EC-4DA1-BCC3-42FA3A09B1CB")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsUIHierWinClipboardHelper = interface
[<System.Runtime.InteropServices.Guid("DF29D855-D0EC-4DA1-BCC3-42FA3A09B1CB")>]
[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IVsUIHierWinClipboardHelper = interface
Public Interface IVsUIHierWinClipboardHelper
Attributes

Remarks

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:

  1. The user performs a cut of a project item from a project hierarchy.

  2. 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.

  3. The source project changes the appearance of the cut item by calling ExpandItem and specifying a value of either EXPF_CutHighlightItem or EXPF_AddCutHighlightItem, as appropriate.

  4. The user performs a paste of the project item.

  5. The destination project handles the contents of the IDataObject, and then communicates that a paste occurred by calling Paste.

  6. 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 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, 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.

Methods

AdviseClipboardHelperEvents(IVsUIHierWinClipboardHelperEvents, UInt32)

Establishes client notification of hierarchy clipboard helper events without the hierarchy implementing IConnectionPointContainer.

Copy(IDataObject)

Copies a data object from a hierarchy to the clipboard.

Cut(IDataObject)

Cuts a data object from a hierarchy to the clipboard.

Paste(IDataObject, UInt32)

Pastes a data object from the clipboard to the hierarchy.

UnadviseClipboardHelperEvents(UInt32)

Disables client notification of hierarchy clipboard helper events without requiring that the hierarchy implement IConnectionPointContainer.

Applies to