Share via


IVsUIHierWinClipboardHelper.Paste Method

Pastes a data object from the clipboard to the hierarchy.

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

Syntax

'Declaration
Function Paste ( _
    pDataObject As IDataObject, _
    dwEffects As UInteger _
) As Integer
int Paste(
    IDataObject pDataObject,
    uint dwEffects
)
int Paste(
    [InAttribute] IDataObject^ pDataObject, 
    [InAttribute] unsigned int dwEffects
)
abstract Paste : 
        pDataObject:IDataObject * 
        dwEffects:uint32 -> int 
function Paste(
    pDataObject : IDataObject, 
    dwEffects : uint
) : int

Parameters

  • pDataObject
    Type: Microsoft.VisualStudio.OLE.Interop.IDataObject
    [in] Pointer to the IDataObject interface on the item being pasted. This data object contains the data being transferred in the paste operation. If the paste occurs, then this data object (hierarchy item) is incorporated into the target hierarchy.
  • dwEffects
    Type: System.UInt32
    [in] Pointer to the value of the pdwEffect parameter of the IVsHierarchy object, identifying all effects that the hierarchy supports.

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 IVsUIHierWinClipboardHelper::Paste(
   [in] IDataObject *pDataObject,
   [in] DWORD dwEffects
);

When a paste occurs on the target hierarchy, the source hierarchy receives paste notification from the environment through the OnPaste method.

Drop effects are included in the dwEffect parameter and describe the action associated with a drop operation. The following table shows possible dwEffect values and their descriptions:

Note

These effects are exclusive and cannot be combined using the bitwise OR operator.

EFFECT name

Value1

Description

DROPEFFECT_NONE

0

Drop target (hierarchy window) cannot accept the data. No drop would be allowed.

DROPEFFECT_COPY

1

Dropped item remains in the source and a copy of it is added to the target.

DROPEFFECT_MOVE

2

Dropped item was added to the target. The item is removed from the source and its storage is deleted.

DROPEFFECT_LINK

4

A link to the source item is added to the target so the item should be removed from the source but the storage should remain so that the link is not broken. A link is therefore a special case of move.

1. The values of the dwEffects parameter are taken from the DROPEFFECT enumeration in the MSDN Library Platform SDK documentation set.

.NET Framework Security

See Also

Reference

IVsUIHierWinClipboardHelper Interface

Microsoft.VisualStudio.Shell.Interop Namespace