internal static DropDataType QueryDropDataType(IOleDataObject pDataObject)
{
if (pDataObject == null)
{
return DropDataType.None;
}
// known formats include File Drops (as from WindowsExplorer),
// VSProject Reference Items and VSProject Storage Items.
var fmt = DragDropHelper.CreateFormatEtc(NativeMethods.CF_HDROP);
if (DragDropHelper.QueryGetData(pDataObject, ref fmt) == VSConstants.S_OK)
{
return DropDataType.Shell;
}
fmt.cfFormat = DragDropHelper.CF_VSREFPROJECTITEMS;
if (DragDropHelper.QueryGetData(pDataObject, ref fmt) == VSConstants.S_OK)
{
// Data is from a Ref-based project.
return DropDataType.VsRef;
}
fmt.cfFormat = DragDropHelper.CF_VSSTGPROJECTITEMS;
if (DragDropHelper.QueryGetData(pDataObject, ref fmt) == VSConstants.S_OK)
{
return DropDataType.VsStg;
}
return DropDataType.None;
}