Exemplo n.º 1
0
 /// <summary>
 /// Toggle TimerDisplay form visibility. Available to a regular user.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void Icon_Click(object sender, EventArgs e)
 {
     if (timerDisplay == null || timerDisplay.IsDisposed)
     {
         timerDisplay      = new TimerDisplay();
         timerDisplay.Left = Screen.PrimaryScreen.WorkingArea.Width - timerDisplay.Size.Width;
         timerDisplay.Top  = Screen.PrimaryScreen.WorkingArea.Height - timerDisplay.Size.Height;
         timerDisplay.Show();
     }
     else
     {
         timerDisplay.Visible = !timerDisplay.Visible;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// User change callback. Alters current Tray Menu
 /// </summary>
 /// <param name="e"></param>
 void OnAuthChange(AuthEventArgs e)
 {
     if (e.User != null)
     {
         if (e.User.IsAdmin)
         {
             TraySetForAdmin();
         }
         else
         {
             TraySetForUser();
         }
     }
     else
     {
         if (timerDisplay != null && !timerDisplay.IsDisposed)
         {
             timerDisplay.Hide();
             timerDisplay.Dispose();
             timerDisplay = null;
         }
         TraySetNoAuth();
     }
 }