MouseGesture.Matches(Object, InputEventArgs) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 MouseGesture 개체와 연결된 입력과 일치하는지 여부를 InputEventArgs 결정합니다.
public:
override bool Matches(System::Object ^ targetElement, System::Windows::Input::InputEventArgs ^ inputEventArgs);
public override bool Matches(object targetElement, System.Windows.Input.InputEventArgs inputEventArgs);
override this.Matches : obj * System.Windows.Input.InputEventArgs -> bool
Public Overrides Function Matches (targetElement As Object, inputEventArgs As InputEventArgs) As Boolean
매개 변수
- targetElement
- Object
대상입니다.
- inputEventArgs
- InputEventArgs
이 제스처와 비교할 입력 이벤트 데이터입니다.
반품
true 이벤트 데이터가 일치하면 이 MouseGesture고, false그렇지 않으면 .
예제
다음 예제에서는 인스턴스와 연결된 입력과 일치하는지 여부를 MouseGesture 테스트하는 방법을 보여 줍니다 InputEventArgs. MouseDown 이벤트 처리기는 메서드를 사용하여 이벤트 데이터를 MouseGesture 비교합니다Matches.
private void OnMouseDown(object sender, MouseEventArgs e)
{
MouseGesture mouseGesture = new MouseGesture(MouseAction.MiddleClick,ModifierKeys.Control);
if (mouseGesture.Matches(null, e))
{
MessageBox.Show("Trapped Mouse Gesture");
}
}
Private Overloads Sub OnMouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim mouseGesture As New MouseGesture(MouseAction.MiddleClick,ModifierKeys.Control)
If mouseGesture.Matches(Nothing, e) Then
MessageBox.Show("Trapped Mouse Gesture")
End If
End Sub