Exemple #1
0
 private StandardCursorType GetCursorForDropEffect(DragDropEffects effects)
 {
     if (effects.HasFlagCustom(DragDropEffects.Copy))
     {
         return(StandardCursorType.DragCopy);
     }
     if (effects.HasFlagCustom(DragDropEffects.Move))
     {
         return(StandardCursorType.DragMove);
     }
     if (effects.HasFlagCustom(DragDropEffects.Link))
     {
         return(StandardCursorType.DragLink);
     }
     return(StandardCursorType.No);
 }
Exemple #2
0
 private DragDropEffects GetPreferredEffect(DragDropEffects effect, RawInputModifiers modifiers)
 {
     if (effect == DragDropEffects.Copy || effect == DragDropEffects.Move || effect == DragDropEffects.Link || effect == DragDropEffects.None)
     {
         return(effect); // No need to check for the modifiers.
     }
     if (effect.HasFlagCustom(DragDropEffects.Link) && modifiers.HasFlagCustom(RawInputModifiers.Alt))
     {
         return(DragDropEffects.Link);
     }
     if (effect.HasFlagCustom(DragDropEffects.Copy) && modifiers.HasFlagCustom(RawInputModifiers.Control))
     {
         return(DragDropEffects.Copy);
     }
     return(DragDropEffects.Move);
 }
Exemple #3
0
        public static DropEffect ConvertDropEffect(DragDropEffects operation)
        {
            DropEffect result = DropEffect.None;

            if (operation.HasFlagCustom(DragDropEffects.Copy))
            {
                result |= DropEffect.Copy;
            }
            if (operation.HasFlagCustom(DragDropEffects.Move))
            {
                result |= DropEffect.Move;
            }
            if (operation.HasFlagCustom(DragDropEffects.Link))
            {
                result |= DropEffect.Link;
            }
            return(result);
        }