} // end of bool Connect() /// <summary> /// Starts to display the screens for the calibration. /// </summary> /// <param name="isRecalibrating">whether to use recalibration or not.</param> /// <returns><strong>True</strong> if calibration succeded, otherwise /// <strong>false</strong>.</returns> public override bool Calibrate(bool isRecalibrating) { if (this.dlgTrackStatus != null) { this.dlgTrackStatus.Dispose(); } this.dlgTrackStatus = new AslTrackStatus(); Rectangle presentationBounds = PresentationScreen.GetPresentationWorkingArea(); this.dlgTrackStatus.Location = new Point( (presentationBounds.Width / 2) - (this.dlgTrackStatus.Width / 2), (presentationBounds.Height / 2) - (this.dlgTrackStatus.Height / 2)); this.dlgTrackStatus.ShowDialog(); return(true); }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> "showOnPresentationScreenButton. /// Implementations should show the track status object /// on the presentation screen. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/>.</param> protected override void BtnShowOnPresentationScreenClick(object sender, EventArgs e) { if (this.ShowOnSecondaryScreenButton.Text.Contains("Show")) { // Should show TrackStatusDlg if (this.dlgTrackStatus != null) { this.dlgTrackStatus.Dispose(); } this.dlgTrackStatus = new SmartEyeTrackStatus(); Rectangle presentationBounds = PresentationScreen.GetPresentationWorkingArea(); this.dlgTrackStatus.Location = new Point( presentationBounds.Left + presentationBounds.Width / 2 - this.dlgTrackStatus.Width / 2, presentationBounds.Top + presentationBounds.Height / 2 - this.dlgTrackStatus.Height / 2); // Dialog will be disposed when connection failed. if (!this.dlgTrackStatus.IsDisposed) { this.ShowOnSecondaryScreenButton.Text = "Hide from presentation screen"; this.ShowOnSecondaryScreenButton.BackColor = System.Drawing.Color.Red; this.dlgTrackStatus.Show(); } this.dlgTrackStatus.FormClosed += (o, e2) => { this.ShowOnSecondaryScreenButton.BackColor = System.Drawing.Color.Transparent; this.ShowOnSecondaryScreenButton.Text = "Show on presentation screen"; }; } else { // Should hide TrackStatusDlg if (this.dlgTrackStatus != null) { this.ShowOnSecondaryScreenButton.BackColor = System.Drawing.Color.Transparent; this.ShowOnSecondaryScreenButton.Text = "Show on presentation screen"; this.dlgTrackStatus.Close(); } } }