Пример #1
0
 /// <summary>
 /// handles the normal splash screen
 /// </summary>
 private void ShowNormalSplash()
 {
   frm = new SplashForm();
   frm.SetVersion(Version);
   frm.Show();
   frm.Update();
   frm.FadeIn();
   string oldInfo = null;
   while (!stopRequested && (frm.Focused || _overlaidForm != null)) //run until stop of splashscreen is requested
   {
     if (AllowWindowOverlayRequested)
     {
       // Allow other Windows to Overlay the splashscreen
       lock(_overlaidFormClosingLock)
       {
         if (_overlaidForm != null && _overlaidForm.Visible) // prepare everything to let the Outdated skin message appear
         {
           if (frm.Focused)
           {
             frm.TopMost = false;
             _overlaidForm.TopMost = true;
             _overlaidForm.BringToFront();
             Cursor.Show();
           }
         }
         else
         {
           AllowWindowOverlayRequested = false;
           frm.TopMost = true;
           frm.BringToFront();
           Cursor.Hide();
         }
       }
     }
     if (oldInfo != info)
     {
       frm.SetInformation(info);
       oldInfo = info;
     }
     Thread.Sleep(25);
     //Application.DoEvents();
   }
   frm.FadeOut();
   frm.Close(); //closes, and disposes the form
   frm = null;
 }
Пример #2
0
    /// <summary>
    /// handles the normal splash screen
    /// </summary>
    private void ShowNormalSplash()
    {
      _frm = new SplashForm {TopMost = _alwaysOnTop};
      _frm.Location = new Point(CurrentDisplay.Bounds.X + CurrentDisplay.Bounds.Width/2 - _frm.Size.Width/2,
                                CurrentDisplay.Bounds.Y + CurrentDisplay.Bounds.Height/2 - _frm.Size.Height/2);
      _frm.SetVersion(Version);
      _frm.Show();
      _frm.Update();
      _frm.FadeIn();
      string oldInfo = null;

      // run until stop of splash screen is requested
      while (!_stopRequested) 
      {
        if (oldInfo != _info)
        {
          _frm.SetInformation(_info);
          oldInfo = _info;
        }
        Thread.Sleep(10);
      }

      _frm.FadeOut();
      _frm.Close();
      _frm = null;
    }
 /// <summary>
 /// Starts the actual splash screen.
 /// </summary>
 /// <remarks>
 /// This method is started in a background thread by the <see cref="Run"/> method.</remarks>
 private void DoRun()
 {
   string oldInfo = null;
   frm = new SplashForm();
   frm.SetVersion(Version);
   frm.Show();
   frm.Update();
   frm.FadeIn();
   while (!stopRequested && (frm.Focused || _allowOverlay)) //run until stop of splashscreen is requested
   {
     if (_allowOverlay == true && _hintForm != null) // Allow other Windows to Overlay the splashscreen
     {
       if (_hintForm.Visible) // prepare everything to let the Outdated skin message appear
       {
         if (frm.Focused)
         {
           frm.TopMost = false;
           _hintForm.TopMost = true;
           _hintForm.BringToFront();
         }
       }
       else
       {
         _allowOverlay = false;
         frm.TopMost = true;
         frm.BringToFront();
       }
     }
     if (oldInfo != info)
     {
       frm.SetInformation(info);
       oldInfo = info;
     }
     Thread.Sleep(25);
   }
   frm.FadeOut();
   frm.Close(); //closes, and disposes the form
   frm = null;
 }