コード例 #1
0
        private bool Drop(float x, float y)
        {
            int[]       coordinates = mCoordinatesTemp;
            IDropTarget dropTarget  = findDropTarget((int)x, (int)y, coordinates);

            if (dropTarget != null)
            {
                dropTarget.OnDragExit(mDragSource, coordinates[0], coordinates[1], (int)mTouchOffsetX, (int)mTouchOffsetY, mDragView, mDragInfo);
                if (dropTarget.AcceptDrop(mDragSource, coordinates[0], coordinates[1], (int)mTouchOffsetX, (int)mTouchOffsetY, mDragView, mDragInfo))
                {
                    dropTarget.OnDrop(mDragSource, coordinates[0], coordinates[1], (int)mTouchOffsetX, (int)mTouchOffsetY, mDragView, mDragInfo);
                    mDragSource.OnDropCompleted((View)dropTarget, true);
                    return(true);
                }
                else
                {
                    mDragSource.OnDropCompleted((View)dropTarget, false);
                    return(true);
                }
            }
            return(false);
        }