Esempio n. 1
0
        /// <summary>
        /// Overridden <see cref="Control.Click"/> event handler for the
        /// <see cref="Button"/> <see cref="TrackerWithStatusControls.ShowOnSecondaryScreenButton"/>.
        /// Shows the track status object on presentation screen outside the Tabpage.
        /// </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.memDlgTrackStatus != null)
                {
                    this.memDlgTrackStatus.Dispose();
                }

                this.memDlgTrackStatus = new GazepointTrackStatus();

                Rectangle presentationBounds = PresentationScreen.GetPresentationWorkingArea();

                this.memDlgTrackStatus.Location = new Point(
                    presentationBounds.Left + presentationBounds.Width / 2 - this.memDlgTrackStatus.Width / 2,
                    presentationBounds.Top + presentationBounds.Height / 2 - this.memDlgTrackStatus.Height / 2);

                // Dialog will be disposed when connection failed.
                if (!this.memDlgTrackStatus.IsDisposed)
                {
                    this.ShowOnSecondaryScreenButton.Text      = "Hide from presentation screen";
                    this.ShowOnSecondaryScreenButton.BackColor = Color.Red;
                    this.memDlgTrackStatus.Show();
                }
            }
            else
            {
                // Should hide TrackStatusDlg
                if (this.memNetworkManager != null)
                {
                    this.ShowOnSecondaryScreenButton.BackColor = Color.Transparent;
                    this.ShowOnSecondaryScreenButton.Text      = "Show on presentation screen";
                    this.memDlgTrackStatus.Close();
                }
            }
        }
Esempio n. 2
0
    /// <summary>
    /// Overridden <see cref="Control.Click"/> event handler for the
    /// <see cref="Button"/> <see cref="TrackerWithStatusControls.ShowOnSecondaryScreenButton"/>.
    /// Shows the track status object on presentation screen outside the Tabpage.
    /// </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.memDlgTrackStatus != null)
        {
          this.memDlgTrackStatus.Dispose();
        }

        this.memDlgTrackStatus = new GazepointTrackStatus();

        Rectangle presentationBounds = PresentationScreen.GetPresentationWorkingArea();

        this.memDlgTrackStatus.Location = new Point(
                            presentationBounds.Left + presentationBounds.Width / 2 - this.memDlgTrackStatus.Width / 2,
                            presentationBounds.Top + presentationBounds.Height / 2 - this.memDlgTrackStatus.Height / 2);

        // Dialog will be disposed when connection failed.
        if (!this.memDlgTrackStatus.IsDisposed)
        {
          this.ShowOnSecondaryScreenButton.Text = "Hide from presentation screen";
          this.ShowOnSecondaryScreenButton.BackColor = Color.Red;
          this.memDlgTrackStatus.Show();
        }
      }
      else
      {
        // Should hide TrackStatusDlg
        if (this.memNetworkManager != null)
        {
          this.ShowOnSecondaryScreenButton.BackColor = Color.Transparent;
          this.ShowOnSecondaryScreenButton.Text = "Show on presentation screen";
          this.memDlgTrackStatus.Close();
        }
      }
    }