69 references to MouseAction
PresentationCore (69)
System\Windows\Input\Command\MouseActionConverter.cs (29)
20
/// Converter class for converting between a <see langword="string"/> and <see cref="
MouseAction
"/>.
25
/// Used to check whether we can convert a <see langword="string"/> into a <see cref="
MouseAction
"/>.
53
return IsDefinedMouseAction((
MouseAction
)context.Instance);
57
/// Converts <paramref name="source"/> of <see langword="string"/> type to its <see cref="
MouseAction
"/> represensation.
62
/// <returns>A <see cref="
MouseAction
"/> representing the <see langword="string"/> specified by <paramref name="source"/>.</returns>
71
_ when mouseActionToken.IsEmpty =>
MouseAction
.None, // Special casing as produced by "ConvertTo"
72
_ when mouseActionToken.Equals("None", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.None,
73
_ when mouseActionToken.Equals("LeftClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.LeftClick,
74
_ when mouseActionToken.Equals("RightClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.RightClick,
75
_ when mouseActionToken.Equals("MiddleClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.MiddleClick,
76
_ when mouseActionToken.Equals("WheelClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.WheelClick,
77
_ when mouseActionToken.Equals("LeftDoubleClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.LeftDoubleClick,
78
_ when mouseActionToken.Equals("RightDoubleClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.RightDoubleClick,
79
_ when mouseActionToken.Equals("MiddleDoubleClick", StringComparison.OrdinalIgnoreCase) =>
MouseAction
.MiddleDoubleClick,
85
/// Converts a <paramref name="value"/> of <see cref="
MouseAction
"/> to its <see langword="string"/> represensation.
91
/// <returns>A <see langword="string"/> representing the <see cref="
MouseAction
"/> specified by <paramref name="value"/>.</returns>
99
return (
MouseAction
)value switch
101
MouseAction
.None => string.Empty,
102
MouseAction
.LeftClick => "LeftClick",
103
MouseAction
.RightClick => "RightClick",
104
MouseAction
.MiddleClick => "MiddleClick",
105
MouseAction
.WheelClick => "WheelClick",
106
MouseAction
.LeftDoubleClick => "LeftDoubleClick",
107
MouseAction
.RightDoubleClick => "RightDoubleClick",
108
MouseAction
.MiddleDoubleClick => "MiddleDoubleClick",
109
_ => throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(
MouseAction
))
118
internal static bool IsDefinedMouseAction(
MouseAction
mouseAction)
120
return mouseAction >=
MouseAction
.None && mouseAction <=
MouseAction
.MiddleDoubleClick;
System\Windows\Input\Command\MouseActionValueSerializer.cs (4)
46
return value is
MouseAction
&& MouseActionConverter.IsDefinedMouseAction((
MouseAction
)value);
57
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
MouseAction
));
72
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
MouseAction
));
System\Windows\Input\Command\MouseBinding.cs (7)
56
internal MouseBinding(ICommand command,
MouseAction
mouseAction)
123
DependencyProperty.Register("MouseAction", typeof(
MouseAction
), typeof(MouseBinding), new UIPropertyMetadata(
MouseAction
.None, new PropertyChangedCallback(OnMouseActionPropertyChanged)));
128
public
MouseAction
MouseAction
132
return (
MouseAction
)GetValue(MouseActionProperty);
143
mouseBinding.SynchronizeGestureFromProperties((
MouseAction
)(e.NewValue));
205
private void SynchronizeGestureFromProperties(
MouseAction
mouseAction)
System\Windows\Input\Command\MouseGesture.cs (24)
50
public MouseGesture(
MouseAction
mouseAction): this(mouseAction, ModifierKeys.None)
59
public MouseGesture(
MouseAction
mouseAction,ModifierKeys modifiers) // acclerator action
62
throw new InvalidEnumArgumentException("mouseAction", (int)mouseAction, typeof(
MouseAction
));
84
public
MouseAction
MouseAction
92
if (!MouseGesture.IsDefinedMouseAction((
MouseAction
)value))
93
throw new InvalidEnumArgumentException("value", (int)value, typeof(
MouseAction
));
96
_mouseAction = (
MouseAction
)value;
133
MouseAction
mouseAction = GetMouseAction(inputEventArgs);
134
if(mouseAction !=
MouseAction
.None)
143
internal static bool IsDefinedMouseAction(
MouseAction
mouseAction)
145
return (mouseAction >=
MouseAction
.None && mouseAction <=
MouseAction
.MiddleDoubleClick);
176
internal static
MouseAction
GetMouseAction(InputEventArgs inputArgs)
178
MouseAction
MouseAction =
MouseAction
.None;
185
MouseAction =
MouseAction
.WheelClick;
196
MouseAction =
MouseAction
.LeftDoubleClick;
198
MouseAction =
MouseAction
.LeftClick;
205
MouseAction =
MouseAction
.RightDoubleClick;
207
MouseAction =
MouseAction
.RightClick;
214
MouseAction =
MouseAction
.MiddleDoubleClick;
216
MouseAction =
MouseAction
.MiddleClick;
233
private
MouseAction
_mouseAction =
MouseAction
.None;
System\Windows\Input\Command\MouseGestureConverter.cs (5)
66
return new MouseGesture(
MouseAction
.None, ModifierKeys.None);
81
TypeConverter mouseActionConverter = TypeDescriptor.GetConverter(typeof(System.Windows.Input.
MouseAction
));
99
return new MouseGesture((
MouseAction
)mouseAction, (ModifierKeys)modifierKeys);
105
return new MouseGesture((
MouseAction
)mouseAction);
169
TypeConverter mouseActionConverter = TypeDescriptor.GetConverter(typeof(System.Windows.Input.
MouseAction
));