Пример #1
0
 public ToolGesture(ToolAction action)
     : this()
 {
     if (!EnumValidator.IsValid(action))
     {
         throw new ArgumentOutOfRangeException("action");
     }
     this._toolAction = action;
 }
Пример #2
0
 public AdornerPlacementValue(AdornerPlacementDimension term, double contribution)
 {
     if (!EnumValidator.IsValid(term))
     {
         throw new ArgumentOutOfRangeException("term");
     }
     this._term         = term;
     this._contribution = contribution;
 }
Пример #3
0
 public ToolGesture(ToolAction action, MouseButton button, ModifierKeys modifiers)
     : this(action, button)
 {
     this.ValidateButton(button);
     if (!EnumValidator.IsValid(action))
     {
         throw new ArgumentOutOfRangeException("action");
     }
     this._toolAction = action;
     this._modifiers  = modifiers;
 }
Пример #4
0
 public static void SetVerticalStretch(UIElement adorner, AdornerStretch value)
 {
     if (adorner == null)
     {
         throw new ArgumentNullException("adorner");
     }
     if (!EnumValidator.IsValid(value))
     {
         throw new ArgumentOutOfRangeException("value");
     }
     adorner.SetValue(AdornerPanel.VerticalStretchProperty, (object)value);
 }
Пример #5
0
 public ToolActionEventArgs(ToolAction toolAction, InputEventArgs sourceEvent)
     : base(sourceEvent == null ? (InputDevice)null : sourceEvent.Device, sourceEvent == null ? 0 : sourceEvent.Timestamp)
 {
     if (sourceEvent == null)
     {
         throw new ArgumentNullException("sourceEvent");
     }
     if (!EnumValidator.IsValid(toolAction))
     {
         throw new ArgumentOutOfRangeException("toolAction");
     }
     this._toolAction  = toolAction;
     this._sourceEvent = (EventArgs)sourceEvent;
 }
Пример #6
0
 public ToolGesture(ToolAction action, MouseButton button)
     : this()
 {
     this.ValidateButton(button);
     if (!EnumValidator.IsValid(action))
     {
         throw new ArgumentOutOfRangeException("action");
     }
     this._toolAction = action;
     for (int index = 0; index < this._buttons.Length; ++index)
     {
         this._buttons[index] = MouseButtonState.Released;
     }
     this._buttons[(int)button] = MouseButtonState.Pressed;
 }
Пример #7
0
 public virtual void SetNudgePlacements(ModelItem item, NudgeIntent intent, RelativeValue[] positions)
 {
     if (item == null)
     {
         throw new ArgumentNullException("item");
     }
     if (positions == null)
     {
         throw new ArgumentNullException("positions");
     }
     if (!EnumValidator.IsValid(intent))
     {
         throw new ArgumentOutOfRangeException("intent");
     }
     this.SetPlacements(item, PlacementIntent.Move, positions);
 }