60 instantiations of MouseGesture
PresentationCore (5)
System\Windows\Input\Command\MouseBinding.cs (2)
48
: this(command, new
MouseGesture
(mouseAction))
205
Gesture = new
MouseGesture
(mouseAction);
System\Windows\Input\Command\MouseGestureConverter.cs (3)
60
return new
MouseGesture
(MouseAction.None, ModifierKeys.None);
93
return new
MouseGesture
((MouseAction)mouseAction, (ModifierKeys)modifierKeys);
99
return new
MouseGesture
((MouseAction)mouseAction);
PresentationCore.Tests (53)
System\Windows\Input\Command\KeyGestureConverter.Tests.cs (3)
68
yield return new object?[] { false, true, new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Alt), typeof(string) };
139
yield return new object?[] { CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control) };
212
yield return new object?[] { new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control), typeof(string) };
System\Windows\Input\Command\MouseGestureConverter.Tests.cs (50)
43
yield return new object[] { true, true, new
MouseGesture
(MouseAction.None, ModifierKeys.Control), typeof(string) };
44
yield return new object[] { true, true, new
MouseGesture
(MouseAction.None, ModifierKeys.Alt), typeof(string) };
45
yield return new object[] { true, true, new
MouseGesture
(MouseAction.MiddleDoubleClick, ModifierKeys.Shift), typeof(string) };
46
yield return new object[] { true, true, new
MouseGesture
(MouseAction.LeftDoubleClick, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt), typeof(string) };
47
yield return new object[] { true, true, new
MouseGesture
(MouseAction.WheelClick, ModifierKeys.Control | ModifierKeys.Windows), typeof(string) };
48
yield return new object[] { true, true, new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Alt | ModifierKeys.Windows), typeof(string) };
49
yield return new object[] { true, true, new
MouseGesture
(MouseAction.RightClick, ModifierKeys.Alt | ModifierKeys.Control), typeof(string) };
50
yield return new object[] { true, true, new
MouseGesture
(MouseAction.RightDoubleClick, ModifierKeys.Alt | ModifierKeys.Windows | ModifierKeys.Control), typeof(string) };
51
yield return new object[] { true, true, new
MouseGesture
(MouseAction.RightDoubleClick, ModifierKeys.None), typeof(string) };
62
yield return new object?[] { false, true, new
MouseGesture
(MouseAction.None, ModifierKeys.Control), null };
63
yield return new object?[] { false, true, new
MouseGesture
(MouseAction.WheelClick, ModifierKeys.Control | ModifierKeys.Windows), typeof(KeyGesture) };
64
yield return new object?[] { false, true, new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Alt | ModifierKeys.Windows), typeof(MouseGesture) };
65
yield return new object?[] { false, true, new
MouseGesture
(MouseAction.None, ModifierKeys.Control), typeof(MouseAction) };
66
yield return new object?[] { false, true, new
MouseGesture
(MouseAction.RightDoubleClick, ModifierKeys.Alt | ModifierKeys.Windows | ModifierKeys.Control), typeof(Key) };
67
yield return new object?[] { false, true, new
MouseGesture
(MouseAction.RightDoubleClick, ModifierKeys.None), typeof(ModifierKeys) };
93
yield return new object?[] { new
MouseGesture
(MouseAction.None, ModifierKeys.None), null, CultureInfo.InvariantCulture, string.Empty };
94
yield return new object?[] { new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.None), null, new CultureInfo("ru-RU"), "LeftClick" };
95
yield return new object?[] { new
MouseGesture
(MouseAction.None, ModifierKeys.Control), null, CultureInfo.InvariantCulture, "Ctrl+" };
96
yield return new object?[] { new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control), null, CultureInfo.InvariantCulture, "Ctrl+LeftClick" };
97
yield return new object?[] { new
MouseGesture
(MouseAction.MiddleDoubleClick, ModifierKeys.Alt), null, new CultureInfo("no-NO"), "Alt+MiddleDoubleClick" };
98
yield return new object?[] { new
MouseGesture
(MouseAction.WheelClick, ModifierKeys.Shift), null, CultureInfo.InvariantCulture, "Shift+WheelClick" };
99
yield return new object?[] { new
MouseGesture
(MouseAction.LeftDoubleClick, ModifierKeys.Windows), null, CultureInfo.InvariantCulture, "Windows+LeftDoubleClick" };
100
yield return new object?[] { new
MouseGesture
(MouseAction.RightClick, ModifierKeys.Control | ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Ctrl+Alt+RightClick" };
101
yield return new object?[] { new
MouseGesture
(MouseAction.RightDoubleClick, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Ctrl+Alt+Windows+RightDoubleClick" };
104
yield return new object?[] { new
MouseGesture
(MouseAction.None, ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Alt+ " };
105
yield return new object?[] { new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.None), null, CultureInfo.InvariantCulture, " LeftClick " };
106
yield return new object?[] { new
MouseGesture
(MouseAction.None, ModifierKeys.None), null, CultureInfo.InvariantCulture, " " };
107
yield return new object?[] { new
MouseGesture
(MouseAction.WheelClick, ModifierKeys.Shift), null, CultureInfo.InvariantCulture, "Shift +WheelClick" };
108
yield return new object?[] { new
MouseGesture
(MouseAction.MiddleClick, ModifierKeys.Windows | ModifierKeys.Shift), null, new CultureInfo("no-NO"), " Shift + Windows + MiddleClick " };
109
yield return new object?[] { new
MouseGesture
(MouseAction.LeftDoubleClick, ModifierKeys.Windows), null, CultureInfo.InvariantCulture, "Windows+ LeftDoubleClick " };
110
yield return new object?[] { new
MouseGesture
(MouseAction.RightClick, ModifierKeys.Control | ModifierKeys.Alt), null, CultureInfo.InvariantCulture, "Ctrl+Alt+ RightClick" };
130
yield return new object?[] { CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control) };
156
yield return new object?[] { string.Empty, null, CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.None, ModifierKeys.None) };
157
yield return new object?[] { "Alt+", null, CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.None, ModifierKeys.Alt) };
158
yield return new object?[] { "Windows+", null, new CultureInfo("de-DE"), new
MouseGesture
(MouseAction.None, ModifierKeys.Windows) };
159
yield return new object?[] { "Shift+", null, new CultureInfo("ru-RU"), new
MouseGesture
(MouseAction.None, ModifierKeys.Shift) };
160
yield return new object?[] { "LeftClick", null, CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.LeftClick) };
161
yield return new object?[] { "Ctrl+LeftClick", null, CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control) };
162
yield return new object?[] { "Alt+RightClick", null, CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.RightClick, ModifierKeys.Alt) };
163
yield return new object?[] { "Windows+WheelClick", null, CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.WheelClick, ModifierKeys.Windows) };
164
yield return new object?[] { "Alt+RightDoubleClick", null, CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.RightDoubleClick, ModifierKeys.Alt) };
165
yield return new object?[] { "Ctrl+Alt+Windows+WheelClick", null, new CultureInfo("de-DE"), new
MouseGesture
(MouseAction.WheelClick, ModifierKeys.Control | ModifierKeys.Windows | ModifierKeys.Alt) };
166
yield return new object?[] { "Alt+Windows+MiddleDoubleClick", null, new CultureInfo("ru-RU"), new
MouseGesture
(MouseAction.MiddleDoubleClick, ModifierKeys.Alt | ModifierKeys.Windows) };
167
yield return new object?[] { "Ctrl+Alt+Windows+MiddleClick", null, CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.MiddleClick, ModifierKeys.Alt | ModifierKeys.Windows | ModifierKeys.Control) };
176
Assert.Throws<ArgumentNullException>(() => converter.ConvertTo(null, CultureInfo.InvariantCulture, new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control), null));
193
yield return new object?[] { new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control), typeof(MouseGesture) };
194
yield return new object?[] { new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control), typeof(KeyGesture) };
195
yield return new object?[] { new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control), typeof(MouseAction) };
196
yield return new object?[] { new
MouseGesture
(MouseAction.LeftClick, ModifierKeys.Control), typeof(Key) };
197
yield return new object?[] { new
MouseGesture
(MouseAction.WheelClick, ModifierKeys.Control), typeof(ModifierKeys) };
PresentationFramework (2)
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
7658
DefaultConstructor = delegate () { return new System.Windows.Input.
MouseGesture
(); },
System\Windows\Markup\KnownTypes.cs (1)
1412
case KnownElements.MouseGesture: o = new System.Windows.Input.
MouseGesture
(); break;
35 references to MouseGesture
PresentationCore (23)
System\Windows\Input\Command\MouseBinding.cs (13)
57
public MouseBinding(ICommand command,
MouseGesture
gesture) : base(command, gesture)
84
return base.Gesture as
MouseGesture
;
88
MouseGesture
oldMouseGesture = Gesture as
MouseGesture
;
89
MouseGesture
mouseGesture = value as
MouseGesture
;
105
throw new ArgumentException(SR.Format(SR.InputBinding_ExpectedInputGesture, typeof(
MouseGesture
)));
177
private void SynchronizePropertiesFromGesture(
MouseGesture
mouseGesture)
209
((
MouseGesture
)Gesture).MouseAction = mouseAction;
223
MouseGesture
mouseGesture = Gesture as
MouseGesture
;
233
MouseGesture
mouseGesture = Gesture as
MouseGesture
;
System\Windows\Input\Command\MouseGesture.cs (2)
58
if (!
MouseGesture
.IsDefinedMouseAction(mouseAction))
89
if (!
MouseGesture
.IsDefinedMouseAction((MouseAction)value))
System\Windows\Input\Command\MouseGestureConverter.cs (4)
121
MouseGesture
mouseGesture = context.Instance as
MouseGesture
;
149
MouseGesture
mouseGesture = value as
MouseGesture
;
System\Windows\Input\Command\MouseGestureValueSerializer.cs (4)
42
MouseGesture
mouseGesture = value as
MouseGesture
;
64
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
MouseGesture
));
79
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
MouseGesture
));
PresentationCore.Tests (9)
System\Windows\Input\Command\KeyGestureConverter.Tests.cs (3)
19
[InlineData(false, typeof(
MouseGesture
))]
64
yield return new object?[] { false, true, new KeyGesture(Key.F5, ModifierKeys.Windows), typeof(
MouseGesture
) };
207
yield return new object?[] { new KeyGesture(Key.V, ModifierKeys.Control), typeof(
MouseGesture
) };
System\Windows\Input\Command\MouseGestureConverter.Tests.cs (6)
19
[InlineData(false, typeof(
MouseGesture
))]
64
yield return new object?[] { false, true, new MouseGesture(MouseAction.LeftClick, ModifierKeys.Alt | ModifierKeys.Windows), typeof(
MouseGesture
) };
79
public void ConvertFrom_ReturnsExpected(
MouseGesture
expected, ITypeDescriptorContext context, CultureInfo? cultureInfo, string value)
83
MouseGesture
converted = (
MouseGesture
)converter.ConvertFrom(context, cultureInfo, value);
193
yield return new object?[] { new MouseGesture(MouseAction.LeftClick, ModifierKeys.Control), typeof(
MouseGesture
) };
PresentationFramework (3)
System\Windows\Markup\Baml2006\Baml2006KnownTypes.cs (1)
508
case 414: t = () => typeof(
MouseGesture
); break;
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
7655
typeof(System.Windows.Input.
MouseGesture
),
System\Windows\Markup\KnownTypes.cs (1)
5962
case KnownElements.MouseGesture: t = typeof(System.Windows.Input.
MouseGesture
); break;