int IOleDropTarget.OleDragEnter(object pDataObj, int grfKeyState, long pt, ref int pdwEffect) { TraceDebug.Trace("OleDragEnter"); POINT pointl = new POINT(); pointl.x = DropTarget.GetX(pt); pointl.y = DropTarget.GetY(pt); // this shouldn't happen, but seems to occasionally, so rather than an Assertion that // will cause a GPF, we'll try and handle it nicely.... if (lastDataObject != null) { // Drag leave wasn't called, so call it now... this.owner.OnDragLeave(EventArgs.Empty); lastDataObject = null; this.lastEffect = DragDropEffects.None; } DragEventArgs e = this.CreateDragEventArgs(pDataObj, grfKeyState, pointl, pdwEffect); if (e != null) { this.owner.OnDragEnter(e); pdwEffect = (int)e.Effect; this.lastEffect = e.Effect; } else { pdwEffect = 0; } return(0); }
int IOleDropTarget.OleDragOver(int grfKeyState, long pt, ref int pdwEffect) { TraceDebug.Trace("OleDragOver"); POINT pointl = new POINT(); pointl.x = DropTarget.GetX(pt); pointl.y = DropTarget.GetY(pt); DragEventArgs e = this.CreateDragEventArgs(lastDataObject, grfKeyState, pointl, pdwEffect); if (e != null) { this.owner.OnDragOver(e); pdwEffect = (int)e.Effect; this.lastEffect = e.Effect; } else { pdwEffect = 0; } return(0); }