Esempio n. 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;
        }
Esempio n. 2
0
        /// <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;
        }
Esempio n. 3
0
 private static void CreateInstance(Type FormType)
 {
     if (_SplashForm == null)
     {
         lock (_obj)
         {
             object obj = FormType.InvokeMember(null,
                                                BindingFlags.DeclaredOnly |
                                                BindingFlags.Public | BindingFlags.NonPublic |
                                                BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null);
             _SplashForm               = obj as SplashForm;
             _SplashForm.TopMost       = true;
             _SplashForm.ShowInTaskbar = false;
             _SplashForm.BringToFront();
             _SplashForm.StartPosition = FormStartPosition.CenterScreen;
             if (_SplashForm == null)
             {
                 throw (new Exception());
             }
         }
     }
 }