Compartilhar via


IVsHierarchyDropDataSource2.OnBeforeDropNotify Method

Enables the drag source to prompt to save unsaved items before dropping. Notifies the source hierarchy that information dragged from it is about to be dropped on a target. This method is called immediately after the mouse button is released on a drop.

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

Syntax

'Declaration
Function OnBeforeDropNotify ( _
    pDataObject As IDataObject, _
    dwEffect As UInteger, _
    <OutAttribute> ByRef pfCancelDrop As Integer _
) As Integer
int OnBeforeDropNotify(
    IDataObject pDataObject,
    uint dwEffect,
    out int pfCancelDrop
)
int OnBeforeDropNotify(
    [InAttribute] IDataObject^ pDataObject, 
    [InAttribute] unsigned int dwEffect, 
    [OutAttribute] int% pfCancelDrop
)
abstract OnBeforeDropNotify : 
        pDataObject:IDataObject * 
        dwEffect:uint32 * 
        pfCancelDrop:int byref -> int
function OnBeforeDropNotify(
    pDataObject : IDataObject, 
    dwEffect : uint, 
    pfCancelDrop : int
) : int

Parameters

  • pDataObject
    Type: Microsoft.VisualStudio.OLE.Interop.IDataObject

    [in] Pointer to the IDataObject interface on the dragged item. Contains the data transferred in the drag-and-drop operation. If the drop occurs, then this data object (item) is incorporated in the hierarchy window of the new hierarchy.

  • dwEffect
    Type: UInt32

    [in] Pointer to a DWORD value indicating the effect of the drop: DROPEFFECT_COPY, DROPEFFECT_LINK, or DROPEFFECT_MOVE. The values are mutually exclusive and cannot be combined.

  • pfCancelDrop
    Type: Int32%

    [out, retval] If true, then the source hierarchy cancelled the drop. If false, then the drop can continue.

Return Value

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

Remarks

COM Signature

From vsshell.idl:

From vsshell.idl:

HRESULT IVsHierarchyDropDataSource2::OnBeforeDropNotify(
   [in] IDataObject *pDataObject,
   [in] DWORD dwEffect,
   [out,retval] BOOL *pfCancelDrop
);

Notes

Use this method to let the data source hierarchy in a drag-and-drop operation allow or disallow a drop based on the data and the key state. The source hierarchy can also use this notification to ask the user to save the source documents, if they are dirty, before transferring them to the target.

.NET Framework Security

See Also

Reference

IVsHierarchyDropDataSource2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace