共用方式為


IVsHierarchyDropDataSource2.OnBeforeDropNotify Method

Definition

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.

public:
 int OnBeforeDropNotify(Microsoft::VisualStudio::OLE::Interop::IDataObject ^ pDataObject, System::UInt32 dwEffect, [Runtime::InteropServices::Out] int % pfCancelDrop);
int OnBeforeDropNotify(Microsoft::VisualStudio::OLE::Interop::IDataObject const & pDataObject, unsigned int dwEffect, [Runtime::InteropServices::Out] int & pfCancelDrop);
public int OnBeforeDropNotify (Microsoft.VisualStudio.OLE.Interop.IDataObject pDataObject, uint dwEffect, out int pfCancelDrop);
abstract member OnBeforeDropNotify : Microsoft.VisualStudio.OLE.Interop.IDataObject * uint32 * int -> int
Public Function OnBeforeDropNotify (pDataObject As IDataObject, dwEffect As UInteger, ByRef pfCancelDrop As Integer) As Integer

Parameters

pDataObject
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
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
Int32

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

Returns

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.

Applies to