-
Notifications
You must be signed in to change notification settings - Fork 976
Expand file tree
/
Copy pathInputCommandBinding.cs
More file actions
60 lines (55 loc) · 2.32 KB
/
Copy pathInputCommandBinding.cs
File metadata and controls
60 lines (55 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="InputCommandBinding.cs" company="OxyPlot">
// Copyright (c) 2014 OxyPlot contributors
// </copyright>
// <summary>
// Represents an binding by an input gesture and a command binding.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace OxyPlot
{
/// <summary>
/// Represents an binding by an input gesture and a command binding.
/// </summary>
public class InputCommandBinding
{
/// <summary>
/// Initializes a new instance of the <see cref="InputCommandBinding" /> class by a gesture.
/// </summary>
/// <param name="gesture">The gesture.</param>
/// <param name="command">The command.</param>
public InputCommandBinding(OxyInputGesture gesture, IViewCommand command)
{
this.Gesture = gesture;
this.Command = command;
}
/// <summary>
/// Initializes a new instance of the <see cref="InputCommandBinding" /> class by a key gesture.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="modifiers">The modifiers.</param>
/// <param name="command">The command.</param>
public InputCommandBinding(OxyKey key, OxyModifierKeys modifiers, IViewCommand command)
: this(new OxyKeyGesture(key, modifiers), command)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="InputCommandBinding" /> class by a mouse gesture.
/// </summary>
/// <param name="mouseButton">The mouse button.</param>
/// <param name="modifiers">The modifiers.</param>
/// <param name="command">The command.</param>
public InputCommandBinding(OxyMouseButton mouseButton, OxyModifierKeys modifiers, IViewCommand command)
: this(new OxyMouseDownGesture(mouseButton, modifiers), command)
{
}
/// <summary>
/// Gets the gesture.
/// </summary>
public OxyInputGesture Gesture { get; private set; }
/// <summary>
/// Gets the command.
/// </summary>
public IViewCommand Command { get; private set; }
}
}