public static void ShowSplash()
 {
     if (_form == null)
     {
         _form = new FormSplash();
         _form.Show();
         _form.Refresh();
     }
 }
 static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
 {
     FormSplash.CloseSplash();
     if (e.Exception is ExceptionIgnore)
     {
     }
     else
     {
         MessageBox.Show(FormExceptionText(e.Exception), "Application Thread Exception");
     }
 }
 public static void CloseSplash()
 {
     if (_form != null && !_form.IsDisposed && !_form.Disposing)
     {
         _form.Close();
         _form = null;
     }
     using (var closeSplashEvent = new EventWaitHandle(false,
                                                       EventResetMode.ManualReset, "CloseSplashScreenEventLimnorStudio"))
     {
         closeSplashEvent.Set();
     }
 }
        static void Main()
        {
            try
            {
#if USECEF
                string cachePath = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "WebCache");
                LimnorStudioPresenter.Init(cachePath);
#endif
                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                FormSplash.ShowSplash();
                Application.Run(new LimnorVOBMain());
            }
            catch (Exception err)
            {
                FormSplash.CloseSplash();
                MessageBox.Show(FormExceptionText(err), "Exception in Main");
            }
        }