예제 #1
0
 public KeySwitcherDragger(IKeyboardQuery keyboard, ModifierKeys activatingKeys,
                           ILocalDragger <T> pressedTarget, ILocalDragger <T> defaultTarget)
 {
     this.keyboard       = keyboard;
     this.pressedTarget  = pressedTarget;
     this.defaultTarget  = defaultTarget;
     this.activatingKeys = activatingKeys;
 }
예제 #2
0
 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)));
예제 #3
0
 public static ILocalDragger <Point> FieldDragger(IKeyboardQuery keyboard,
                                                  double initialX, double initialY, ILocalDragger <Point> target) =>
 FieldDragger(keyboard, new Point(initialX, initialY), target);
예제 #4
0
 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);