Example #1
0
        private void Track(TrackingType trackingType)
        {
            TrackingSettings trackingSettings;
             TrackerChangedEventArgs ea;
             frmTrackBounds selectBoundsView;
             switch (trackingType) {
            case TrackingType.None:
            case TrackingType.Full:
               trackingSettings = new TrackingSettings() {
                  Type = trackingType,
               };
               ea = new TrackerChangedEventArgs(trackingSettings);
               this.OnTrackerChanged(ea);
               break;
            case TrackingType.Fixed:
            case TrackingType.MouseCursor:
               bool trackingMouseCursor = trackingType == TrackingType.MouseCursor;
               selectBoundsView = new frmTrackBounds();
               this.isSelectingTracker = true;
               selectBoundsView.IsFixedAroundCursor = trackingMouseCursor;
               if (this.trackingSettings.Type == trackingType) {
                  selectBoundsView.Bounds = this.TrackingSettings.Bounds;
               }
               else {
                  Rectangle screenBounds = System.Windows.Forms.Screen.PrimaryScreen.Bounds;
                  selectBoundsView.Bounds = new Rectangle(
                     screenBounds.Width / 4,
                     screenBounds.Height / 4,
                     screenBounds.Width / 2,
                     screenBounds.Height / 2);
               }
               if (selectBoundsView.ShowDialog()) {
                  this.isSelectingTracker = false;
                  trackingSettings = new TrackingSettings() {
                     Bounds = selectBoundsView.Bounds,
                     Type = trackingType,
                  };
                  ea = new TrackerChangedEventArgs(trackingSettings);
                  this.OnTrackerChanged(ea);
               }
               break;

            case TrackingType.Window:
               break;
             }
        }
Example #2
0
 private void OnTrackerChanged(TrackerChangedEventArgs ea)
 {
     TrackingSettings trackingSettings = ea.TrackingSettings;
      this.TrackingSettings = trackingSettings;
      if (this.TrackerChanged != null) {
     this.TrackerChanged(this, ea);
      }
 }
Example #3
0
 private void view_TrackerChanged(object sender, TrackerChangedEventArgs e)
 {
     this.ChangeTracker(e.TrackingSettings);
 }
Example #4
0
 private void EndWindowFinding()
 {
     Debug.Assert(this.windowFinder.IsFinding, "Unexpected call of EndWindowFinding()");
      if (this.windowFinder.IsFinding) {
     Cursor.Current = Cursors.Default;
     IntPtr hWnd = this.windowFinder.EndFind();
     this.isSelectingTracker = false;
     if (hWnd != IntPtr.Zero) {
        this.prevTrackingWindowText = this.tsmiWindow.Text;
        this.UpdateTooltip();
        TrackingSettings trackerSettings = new TrackingSettings() {
           Hwnd = hWnd,
           Type = TrackingType.Window,
        };
        TrackerChangedEventArgs ea = new TrackerChangedEventArgs(trackerSettings);
        this.OnTrackerChanged(ea);
     }
     else {
        if (this.prevTrackingSettings.Type != TrackingType.Window) {
           this.tsmiWindow.Text = trackingTypeWindow;
        }
        else {
           this.tsmiWindow.Text = prevTrackingWindowText;
        }
        this.TrackingSettings = this.prevTrackingSettings;
     }
      }
 }
Example #5
0
 private void view_TrackerChanged(object sender, TrackerChangedEventArgs e)
 {
     this.ChangeTracker(e.TrackingSettings);
 }