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