Esempio n. 1
0
 protected void MouseCapture_PointCaptured(object sender, PointsCapturedEventArgs e)
 {
     if (Properties.Settings.Default.VisualFeedbackWidth > 0 && e.State == CaptureState.Capturing)
         this.DrawSegments(e.Points);
 }
Esempio n. 2
0
 protected void Instance_AfterPointsCaptured(object sender, PointsCapturedEventArgs e)
 {
     if (Properties.Settings.Default.Teaching)
     {
         _CapturedPoints = e.Points;
         this.Show();
         this.Activate();
         PopulateForm();
     }
 }
Esempio n. 3
0
        private bool TryBeginCapture(PointF FirstPoint)
        {
            // Create capture args so we can notify subscribers that capture has started and allow them to cancel if they want.
            PointsCapturedEventArgs captureStartedArgs = new PointsCapturedEventArgs(new PointF[] { FirstPoint });
            OnCaptureStarted(captureStartedArgs);
            if (captureStartedArgs.Cancel)
                return false;

            // Beginning of new gesture, set to CapturingInvalid state because the capture isn't official yet,
            // if the user chooses to release the mouse button during the CapturingInvalid state, then we'll
            // simulate the original mouse event
            State = CaptureState.CapturingInvalid;

            // Clear old gesture from point list so we can start adding the new captures points to the list
            _PointsCaptured.Clear();

            // Add the first point to the newly emptied list
            AddPoint(FirstPoint);

            return true;
        }
Esempio n. 4
0
 protected void MouseCapture_CaptureEnded(object sender, PointsCapturedEventArgs e)
 {
     if (Properties.Settings.Default.VisualFeedbackWidth > 0)
         this.EndDraw();
 }
Esempio n. 5
0
 protected virtual void OnPointCaptured(PointsCapturedEventArgs e)
 {
     if (PointCaptured != null) PointCaptured(this, e);
 }
Esempio n. 6
0
        private void EndCapture()
        {
            // Create points capture event args, to be used to send off to event subscribers or to simulate original mouse event
            PointsCapturedEventArgs pointsInformation = new PointsCapturedEventArgs(InputPoints, State);

            // We've completed a successful capture, set state back to ready
            State = CaptureState.Ready;

            // Notify subscribers that capture has ended
            OnCaptureEnded(pointsInformation);

            // Notify PointsCaptured event subscribers that points have been captured.
            OnBeforePointsCaptured(pointsInformation);

            if (!pointsInformation.Cancel)
                OnAfterPointsCaptured(pointsInformation);
        }
Esempio n. 7
0
 protected virtual void OnBeforePointsCaptured(PointsCapturedEventArgs e)
 {
     if (BeforePointsCaptured != null) BeforePointsCaptured(this, e);
 }
Esempio n. 8
0
 protected virtual void OnCaptureStarted(PointsCapturedEventArgs e)
 {
     if (CaptureStarted != null) CaptureStarted(this, e);
 }
Esempio n. 9
0
 protected virtual void OnAfterPointsCaptured(PointsCapturedEventArgs e)
 {
     if (AfterPointsCaptured != null) AfterPointsCaptured(this, e);
 }
Esempio n. 10
0
 protected void MouseCapture_CaptureStarted(object sender, PointsCapturedEventArgs e)
 {
     CaptureWindow = GetWindowFromPoint(e.CapturePoint);
     if (GetApplicationFromWindow(CaptureWindow) is IgnoredApplication)
         e.Cancel = true;
 }
Esempio n. 11
0
 protected void MouseCapture_BeforePointsCaptured(object sender, PointsCapturedEventArgs e)
 {
     // Derive capture window from capture point
     CaptureWindow = GetWindowFromPoint(e.CapturePoint);
     CurrentApplication = GetApplicationFromWindow(CaptureWindow);
 }
Esempio n. 12
0
 protected void MouseCapture_BeforePointsCaptured(object sender, PointsCapturedEventArgs e)
 {
     this.GestureName = GetGestureName(e.Points);
 }
Esempio n. 13
0
 protected void MouseCapture_AfterPointsCaptured(object sender, PointsCapturedEventArgs e)
 {
     RecognizeGesture(e.Points, e.CapturePoint);
 }