Make these 3 calls: CreateAndShow(), StayAboveThisWindow(), FadeAndClose()
Inheritance: System.Windows.Forms.Form
Ejemplo n.º 1
0
 public static SplashScreen CreateAndShow()
 {
     var f = new SplashScreen();
     f.Show();
     Application.DoEvents();//show the splash
     return f;
 }
Ejemplo n.º 2
0
        private static void CloseSplashScreenAndCheckRegistration()
        {
            if (_splashForm != null)
            {
                _splashForm.FadeAndClose(); //it's going to hang around while it fades,
                _splashForm = null; //but we are done with it
            }

            if (RegistrationDialog.ShouldWeShowRegistrationDialog())
            {
                using (var dlg = new RegistrationDialog(false))
                {
                    if (_projectContext!=null && _projectContext.ProjectWindow != null)
                        dlg.ShowDialog(_projectContext.ProjectWindow);
                    else
                    {
                        dlg.ShowDialog();
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private static void CloseSplashScreen()
        {
            _alreadyHadSplashOnce = true;
            Application.Idle -= CareForSplashScreenAtIdleTime;

            if (_splashForm != null)
            {
                if (RegistrationDialog.ShouldWeShowRegistrationDialog())
                {
                    _splashForm.Hide();//the fading was getting stuck when we showed the registration.
                }
                _splashForm.FadeAndClose(); //it's going to hang around while it fades,
                _splashForm = null; //but we are done with it
            }
        }
Ejemplo n.º 4
0
 private static void CareForSplashScreenAtIdleTime(object sender, EventArgs e)
 {
     //this is a hack... somehow this is getting called again, haven't been able to track down how
     //to reproduce, remove the user settings so that we get first-run behavior. Instead of going through the
     //wizard, cancel it and open an existing project. After the new collectino window is created, this
     //fires *again* and would try to open a new splashform
     if (_alreadyHadSplashOnce)
     {
         Application.Idle -= CareForSplashScreenAtIdleTime;
         return;
     }
     if(_splashForm==null)
         _splashForm = SplashScreen.CreateAndShow();//warning: this does an ApplicationEvents()
     else if (DateTime.Now > _earliestWeShouldCloseTheSplashScreen)
     {
         _alreadyHadSplashOnce = true;
         Application.Idle -= CareForSplashScreenAtIdleTime;
         CloseSplashScreenAndCheckRegistration();
         if (_projectContext!=null && _projectContext.ProjectWindow != null)
         {
             var shell = _projectContext.ProjectWindow as Shell;
             if (shell != null)
             {
                 shell.ReallyComeToFront();
             }
         }
     }
 }
Ejemplo n.º 5
0
 private static void CareForSplashScreenAtIdleTime(object sender, EventArgs e)
 {
     //this is a hack... somehow this is getting called again, haven't been able to track down how
     //to reproduce, remove the user settings so that we get first-run behavior. Instead of going through the
     //wizard, cancel it and open an existing project. After the new collectino window is created, this
     //fires *again* and would try to open a new splashform
     if (_alreadyHadSplashOnce)
     {
         Application.Idle -= CareForSplashScreenAtIdleTime;
         return;
     }
     if(_splashForm==null)
         _splashForm = SplashScreen.CreateAndShow();//warning: this does an ApplicationEvents()
     else if (DateTime.Now > _earliestWeShouldCloseTheSplashScreen)
     {
         // BL-3192. If there is some modal in front (e.g. dropbox or screen DPI warnings), just wait. We'll keep getting called with these
         // on idle warnings until it closes, then we can proceed.
         if (_splashForm.Visible && !_splashForm.CanFocus)
         {
             return;
         }
         CloseSplashScreen();
         CheckRegistration();
         if (_projectContext != null && _projectContext.ProjectWindow != null)
         {
             var shell = _projectContext.ProjectWindow as Shell;
             if (shell != null)
             {
                 shell.ReallyComeToFront();
             }
         }
     }
 }