internal static Application bootDover(Application doverApp) { if (bootDoverHelper != null) { throw new Exception("Dover is running"); } bootDoverHelper = new BootDoverHelper(doverApp); Thread t = new Thread(bootDoverHelper.Start); bootDoverHelper.bootThread = t; t.SetApartmentState(ApartmentState.STA); t.Start(); int count = 0; while (bootDoverHelper.app == null || !bootDoverHelper.app.Initialized) { Thread.Sleep(5000); if (count >= 60) { throw new Exception("5 minutes connection timeout"); } ++count; } return(bootDoverHelper.app); }
internal static void shutdownDover() { if (bootDoverHelper != null) { bootDoverHelper.Shutdown(); bootDoverHelper = null; } var domains = DomainHelper.LoadedDomains; Assert.AreEqual(2, domains.Count()); }
internal static Application bootDover(Application doverApp) { if (bootDoverHelper != null) throw new Exception("Dover is running"); bootDoverHelper = new BootDoverHelper(doverApp); Thread t = new Thread(bootDoverHelper.Start); bootDoverHelper.bootThread = t; t.SetApartmentState(ApartmentState.STA); t.Start(); int count = 0; while (bootDoverHelper.app == null || !bootDoverHelper.app.Initialized) { Thread.Sleep(5000); if (count >= 60) throw new Exception("5 minutes connection timeout"); ++count; } return bootDoverHelper.app; }