69 references to MouseAction
PresentationCore (69)
System\Windows\Input\Command\MouseActionConverter.cs (29)
11
/// Converter class for converting between a <see langword="string"/> and <see cref="
MouseAction
"/>.
16
/// Used to check whether we can convert a <see langword="string"/> into a <see cref="
MouseAction
"/>.
44
return IsDefinedMouseAction((
MouseAction
)context.Instance);
48
/// Converts <paramref name="source"/> of <see langword="string"/> type to its <see cref="
MouseAction
"/> represensation.
53
/// <returns>A <see cref="
MouseAction
"/> representing the <see langword="string"/> specified by <paramref name="source"/>.</returns>
62
_ when mouseActionToken.IsEmpty =>
MouseAction
.None, // Special casing as produced by "ConvertTo"
63
_ when mouseActionToken.Equals("None", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.None,
64
_ when mouseActionToken.Equals("LeftClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.LeftClick,
65
_ when mouseActionToken.Equals("RightClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.RightClick,
66
_ when mouseActionToken.Equals("MiddleClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.MiddleClick,
67
_ when mouseActionToken.Equals("WheelClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.WheelClick,
68
_ when mouseActionToken.Equals("LeftDoubleClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.LeftDoubleClick,
69
_ when mouseActionToken.Equals("RightDoubleClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.RightDoubleClick,
70
_ when mouseActionToken.Equals("MiddleDoubleClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.MiddleDoubleClick,
76
/// Converts a <paramref name="value"/> of <see cref="
MouseAction
"/> to its <see langword="string"/> represensation.
82
/// <returns>A <see langword="string"/> representing the <see cref="
MouseAction
"/> specified by <paramref name="value"/>.</returns>
90
return (
MouseAction
)value switch
92
MouseAction
.None => string.Empty,
93
MouseAction
.LeftClick => "LeftClick",
94
MouseAction
.RightClick => "RightClick",
95
MouseAction
.MiddleClick => "MiddleClick",
96
MouseAction
.WheelClick => "WheelClick",
97
MouseAction
.LeftDoubleClick => "LeftDoubleClick",
98
MouseAction
.RightDoubleClick => "RightDoubleClick",
99
MouseAction
.MiddleDoubleClick => "MiddleDoubleClick",
100
_ => throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(
MouseAction
))
109
internal static bool IsDefinedMouseAction(
MouseAction
mouseAction)
111
return mouseAction >=
MouseAction
.None && mouseAction <=
MouseAction
.MiddleDoubleClick;
System\Windows\Input\Command\MouseActionValueSerializer.cs (4)
41
return value is
MouseAction
&& MouseActionConverter.IsDefinedMouseAction((
MouseAction
)value);
52
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
MouseAction
));
67
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
MouseAction
));
System\Windows\Input\Command\MouseBinding.cs (7)
47
internal MouseBinding(ICommand command,
MouseAction
mouseAction)
114
DependencyProperty.Register("MouseAction", typeof(
MouseAction
), typeof(MouseBinding), new UIPropertyMetadata(
MouseAction
.None, new PropertyChangedCallback(OnMouseActionPropertyChanged)));
119
public
MouseAction
MouseAction
123
return (
MouseAction
)GetValue(MouseActionProperty);
134
mouseBinding.SynchronizeGestureFromProperties((
MouseAction
)(e.NewValue));
196
private void SynchronizeGestureFromProperties(
MouseAction
mouseAction)
System\Windows\Input\Command\MouseGesture.cs (24)
47
public MouseGesture(
MouseAction
mouseAction): this(mouseAction, ModifierKeys.None)
56
public MouseGesture(
MouseAction
mouseAction,ModifierKeys modifiers) // acclerator action
59
throw new InvalidEnumArgumentException("mouseAction", (int)mouseAction, typeof(
MouseAction
));
81
public
MouseAction
MouseAction
89
if (!MouseGesture.IsDefinedMouseAction((
MouseAction
)value))
90
throw new InvalidEnumArgumentException("value", (int)value, typeof(
MouseAction
));
93
_mouseAction = (
MouseAction
)value;
130
MouseAction
mouseAction = GetMouseAction(inputEventArgs);
131
if(mouseAction !=
MouseAction
.None)
140
internal static bool IsDefinedMouseAction(
MouseAction
mouseAction)
142
return (mouseAction >=
MouseAction
.None && mouseAction <=
MouseAction
.MiddleDoubleClick);
173
internal static
MouseAction
GetMouseAction(InputEventArgs inputArgs)
175
MouseAction
MouseAction =
MouseAction
.None;
182
MouseAction =
MouseAction
.WheelClick;
193
MouseAction =
MouseAction
.LeftDoubleClick;
195
MouseAction =
MouseAction
.LeftClick;
202
MouseAction =
MouseAction
.RightDoubleClick;
204
MouseAction =
MouseAction
.RightClick;
211
MouseAction =
MouseAction
.MiddleDoubleClick;
213
MouseAction =
MouseAction
.MiddleClick;
230
private
MouseAction
_mouseAction =
MouseAction
.None;
System\Windows\Input\Command\MouseGestureConverter.cs (5)
60
return new MouseGesture(
MouseAction
.None, ModifierKeys.None);
75
TypeConverter mouseActionConverter = TypeDescriptor.GetConverter(typeof(System.Windows.Input.
MouseAction
));
93
return new MouseGesture((
MouseAction
)mouseAction, (ModifierKeys)modifierKeys);
99
return new MouseGesture((
MouseAction
)mouseAction);
163
TypeConverter mouseActionConverter = TypeDescriptor.GetConverter(typeof(System.Windows.Input.
MouseAction
));