protected void MouseCapture_PointCaptured(object sender, PointsCapturedEventArgs e) { if (Properties.Settings.Default.VisualFeedbackWidth > 0 && e.State == CaptureState.Capturing) this.DrawSegments(e.Points); }
protected void Instance_AfterPointsCaptured(object sender, PointsCapturedEventArgs e) { if (Properties.Settings.Default.Teaching) { _CapturedPoints = e.Points; this.Show(); this.Activate(); PopulateForm(); } }
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; }
protected void MouseCapture_CaptureEnded(object sender, PointsCapturedEventArgs e) { if (Properties.Settings.Default.VisualFeedbackWidth > 0) this.EndDraw(); }
protected virtual void OnPointCaptured(PointsCapturedEventArgs e) { if (PointCaptured != null) PointCaptured(this, e); }
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); }
protected virtual void OnBeforePointsCaptured(PointsCapturedEventArgs e) { if (BeforePointsCaptured != null) BeforePointsCaptured(this, e); }
protected virtual void OnCaptureStarted(PointsCapturedEventArgs e) { if (CaptureStarted != null) CaptureStarted(this, e); }
protected virtual void OnAfterPointsCaptured(PointsCapturedEventArgs e) { if (AfterPointsCaptured != null) AfterPointsCaptured(this, e); }
protected void MouseCapture_CaptureStarted(object sender, PointsCapturedEventArgs e) { CaptureWindow = GetWindowFromPoint(e.CapturePoint); if (GetApplicationFromWindow(CaptureWindow) is IgnoredApplication) e.Cancel = true; }
protected void MouseCapture_BeforePointsCaptured(object sender, PointsCapturedEventArgs e) { // Derive capture window from capture point CaptureWindow = GetWindowFromPoint(e.CapturePoint); CurrentApplication = GetApplicationFromWindow(CaptureWindow); }
protected void MouseCapture_BeforePointsCaptured(object sender, PointsCapturedEventArgs e) { this.GestureName = GetGestureName(e.Points); }
protected void MouseCapture_AfterPointsCaptured(object sender, PointsCapturedEventArgs e) { RecognizeGesture(e.Points, e.CapturePoint); }