public KeySwitcherDragger(IKeyboardQuery keyboard, ModifierKeys activatingKeys, ILocalDragger <T> pressedTarget, ILocalDragger <T> defaultTarget) { this.keyboard = keyboard; this.pressedTarget = pressedTarget; this.defaultTarget = defaultTarget; this.activatingKeys = activatingKeys; }
private static ILocalDragger <Point> FieldDragger( IKeyboardQuery keyboard, Point initialPoint, ILocalDragger <Point> target) => InitialPoint(initialPoint, OnKey(keyboard, ModifierKeys.Shift, i => new RestrictToAxis(i), OnKey(keyboard, ModifierKeys.Alt, i => GridSnapping(5, i), target)));
public static ILocalDragger <Point> FieldDragger(IKeyboardQuery keyboard, double initialX, double initialY, ILocalDragger <Point> target) => FieldDragger(keyboard, new Point(initialX, initialY), target);
public static ILocalDragger <T> OnKey <T>(IKeyboardQuery keyboard, ModifierKeys modifier, Func <ILocalDragger <T>, ILocalDragger <T> > whenPressed, ILocalDragger <T> unpressed) where T : struct => new KeySwitcherDragger <T>(keyboard, modifier, whenPressed(unpressed), unpressed);