protected void StopDrag(bool accept) { bool valid = dragCallback(accept, location); // if the callback accepts the placement, then stop the drag and clean up if (valid) { app.ReleaseMouse(); if (disposeDragObject) { dragObject.Dispose(); } dragging = false; } }