Exemplo n.º 1
0
        /// <summary>
        /// The <see cref="Control.Click"/> event handler for the
        ///   <see cref="Button"/> <see cref="TrackerWithStatusControls.ShowOnSecondaryScreenButton"/>.
        ///   Shows a new track status object in a new thread.
        /// </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 TheEyeTribeTrackStatusDialog();

                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 = Color.Red;
                    this.dlgTrackStatus.Show();
                    //this.dlgTrackStatus.trackBoxStatus.Connect();
                }
            }
            else
            {
                // Should hide TrackStatusDlg
                if (this.dlgTrackStatus != null)
                {
                    this.ShowOnSecondaryScreenButton.BackColor = Color.Transparent;
                    this.ShowOnSecondaryScreenButton.Text      = "Show on presentation screen";
                    //this.dlgTrackStatus.trackBoxStatus.Disconnect();
                    this.dlgTrackStatus.Close();
                }
            }
        }
Exemplo n.º 2
0
    /// <summary>
    /// The <see cref="Control.Click"/> event handler for the
    ///   <see cref="Button"/> <see cref="TrackerWithStatusControls.ShowOnSecondaryScreenButton"/>.
    ///   Shows a new track status object in a new thread.
    /// </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 TheEyeTribeTrackStatusDialog();

        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 = Color.Red;
          this.dlgTrackStatus.Show();
          //this.dlgTrackStatus.trackBoxStatus.Connect();
        }
      }
      else
      {
        // Should hide TrackStatusDlg
        if (this.dlgTrackStatus != null)
        {
          this.ShowOnSecondaryScreenButton.BackColor = Color.Transparent;
          this.ShowOnSecondaryScreenButton.Text = "Show on presentation screen";
          //this.dlgTrackStatus.trackBoxStatus.Disconnect();
          this.dlgTrackStatus.Close();
        }
      }
    }