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); }
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); }
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); }