IVsUIHierWinClipboardHelperEvents.OnClear Method

Signals that the clipboard has been cleared.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function OnClear ( _
    fDataWasCut As Integer _
) As Integer
'Usage
Dim instance As IVsUIHierWinClipboardHelperEvents 
Dim fDataWasCut As Integer 
Dim returnValue As Integer 

returnValue = instance.OnClear(fDataWasCut)
int OnClear(
    int fDataWasCut
)
int OnClear(
    [InAttribute] int fDataWasCut
)
function OnClear(
    fDataWasCut : int
) : int

Parameters

  • fDataWasCut
    Type: System.Int32

    [in] This flag informs the source that the Cut method was called (true), rather than Copy (false), so the source knows whether to "un-cut-highlight" the items that were cut.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsUIHierWinClipboardHelperEvents::OnClear(
   [in] BOOL fDataWasCut
);

Usually a hierarchy that is informing the environment of a cut or copy operation by calling Cut or Copy also listens to IVsUIHierWinClipboardHelperEvents. However, the hierarchy might lose context on whether a cut or a copy operation was performed long before the paste or clear occurs. The IVsUIHierWinClipboardHelperEvents.OnClear method informs the hierarchy from which the object was cut or copied that a cut or copy was performed (as determined by the value of the fDataWasCut parameter). The hierarchy can then reset the "cut-highlight" state of any items that were placed on the clipboard.

One IDataObject at a time can be stored on the clipboard. When the contents of the clipboard change, and the cut IDataObject is no longer on the clipboard, the IVsUIHierWinClipboardHelperEvents.OnClear method of each listener is called so that the cut item can be undimmed by calling ExpandItem and specifying a value of EXPF_UnCutHighlightItem.

This notification is significant because the clipboard is only cleared when the user cuts or copies a different item to it. The clipboard is not cleared on a paste.

.NET Framework Security

See Also

Reference

IVsUIHierWinClipboardHelperEvents Interface

IVsUIHierWinClipboardHelperEvents Members

Microsoft.VisualStudio.Shell.Interop Namespace