@@ -763,14 +763,14 @@ bool IRenderWebBrowser.StartDragging(IDragData dragData, DragOperationsMask allo
763763 if ( browser != null )
764764 {
765765 //DoDragDrop will fire DragEnter event
766- var result = DragDrop . DoDragDrop ( this , dataObject , GetDragEffects ( allowedOps ) ) ;
766+ var result = DragDrop . DoDragDrop ( this , dataObject , allowedOps . GetDragEffects ( ) ) ;
767767
768768 //DragData was stored so when DoDragDrop fires DragEnter we reuse a clone of the IDragData provided here
769769 currentDragData = null ;
770770
771771 //If result == DragDropEffects.None then we'll send DragOperationsMask.None
772772 //effectively cancelling the drag operation
773- browser . GetHost ( ) . DragSourceEndedAt ( x , y , GetDragOperationsMask ( result ) ) ;
773+ browser . GetHost ( ) . DragSourceEndedAt ( x , y , result . GetDragOperationsMask ( ) ) ;
774774 browser . GetHost ( ) . DragSourceSystemDragEnded ( ) ;
775775 }
776776 } ) ;
@@ -1501,7 +1501,7 @@ private void OnDrop(object sender, DragEventArgs e)
15011501 if ( browser != null )
15021502 {
15031503 var mouseEvent = GetMouseEvent ( e ) ;
1504- var effect = GetDragOperationsMask ( e . AllowedEffects ) ;
1504+ var effect = e . AllowedEffects . GetDragOperationsMask ( ) ;
15051505
15061506 browser . GetHost ( ) . DragTargetDragOver ( mouseEvent , effect ) ;
15071507 browser . GetHost ( ) . DragTargetDragDrop ( mouseEvent ) ;
@@ -1530,7 +1530,7 @@ private void OnDragOver(object sender, DragEventArgs e)
15301530 {
15311531 if ( browser != null )
15321532 {
1533- browser . GetHost ( ) . DragTargetDragOver ( GetMouseEvent ( e ) , GetDragOperationsMask ( e . AllowedEffects ) ) ;
1533+ browser . GetHost ( ) . DragTargetDragOver ( GetMouseEvent ( e ) , e . AllowedEffects . GetDragOperationsMask ( ) ) ;
15341534 }
15351535 }
15361536
@@ -1554,7 +1554,7 @@ private void OnDragEnter(object sender, DragEventArgs e)
15541554 if ( browser != null )
15551555 {
15561556 var mouseEvent = GetMouseEvent ( e ) ;
1557- var effect = GetDragOperationsMask ( e . AllowedEffects ) ;
1557+ var effect = e . AllowedEffects . GetDragOperationsMask ( ) ;
15581558
15591559 //DoDragDrop will fire this handler for internally sourced Drag/Drop operations
15601560 //we use the existing IDragData (cloned copy)
@@ -1565,62 +1565,6 @@ private void OnDragEnter(object sender, DragEventArgs e)
15651565 }
15661566 }
15671567
1568- /// <summary>
1569- /// Converts .NET drag drop effects to CEF Drag Operations
1570- /// </summary>
1571- /// <param name="dragDropEffects">The drag drop effects.</param>
1572- /// <returns>DragOperationsMask.</returns>
1573- /// s
1574- private static DragOperationsMask GetDragOperationsMask ( DragDropEffects dragDropEffects )
1575- {
1576- var operations = DragOperationsMask . None ;
1577-
1578- if ( dragDropEffects . HasFlag ( DragDropEffects . All ) )
1579- {
1580- operations |= DragOperationsMask . Every ;
1581- }
1582- if ( dragDropEffects . HasFlag ( DragDropEffects . Copy ) )
1583- {
1584- operations |= DragOperationsMask . Copy ;
1585- }
1586- if ( dragDropEffects . HasFlag ( DragDropEffects . Move ) )
1587- {
1588- operations |= DragOperationsMask . Move ;
1589- }
1590- if ( dragDropEffects . HasFlag ( DragDropEffects . Link ) )
1591- {
1592- operations |= DragOperationsMask . Link ;
1593- }
1594-
1595- return operations ;
1596- }
1597-
1598- /// <summary>
1599- /// Gets the drag effects.
1600- /// </summary>
1601- /// <param name="mask">The mask.</param>
1602- /// <returns>DragDropEffects.</returns>
1603- private static DragDropEffects GetDragEffects ( DragOperationsMask mask )
1604- {
1605- if ( ( mask & DragOperationsMask . Every ) == DragOperationsMask . Every )
1606- {
1607- return DragDropEffects . All ;
1608- }
1609- if ( ( mask & DragOperationsMask . Copy ) == DragOperationsMask . Copy )
1610- {
1611- return DragDropEffects . Copy ;
1612- }
1613- if ( ( mask & DragOperationsMask . Move ) == DragOperationsMask . Move )
1614- {
1615- return DragDropEffects . Move ;
1616- }
1617- if ( ( mask & DragOperationsMask . Link ) == DragOperationsMask . Link )
1618- {
1619- return DragDropEffects . Link ;
1620- }
1621- return DragDropEffects . None ;
1622- }
1623-
16241568 /// <summary>
16251569 /// PresentationSource changed handler.
16261570 /// </summary>
0 commit comments