protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); // Configure Log4Net XmlConfigurator.Configure(); // Configure Bootstrapper var bootstrapper = new Bootstrapper(); bootstrapper.Run(); }
// TODO: Move to shared DLL protected static void AssertExceptionThrownOnRun(Bootstrapper bootstrapper, Type expectedExceptionType, string expectedExceptionMessageSubstring) { bool exceptionThrown = false; try { bootstrapper.Run(); } catch (Exception ex) { Assert.AreEqual(expectedExceptionType, ex.GetType()); StringAssert.Contains(ex.Message, expectedExceptionMessageSubstring); exceptionThrown = true; } if (!exceptionThrown) { Assert.Fail("Exception not thrown."); } }
/// <summary> /// Handles startup of the application by setting the configuration encryption key for retrieving config, then /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void OnStartup(object sender, StartupEventArgs e) { // set encryption key ConfigurationManager.EncryptionKey = CONFIG_ENCRYPTION_KEY; // load up all available data contract types DataContractUtility.LoadDataContractTypes(); // start the app once loaded ConfigurationLoaded += (app, args) => { Deployment.Current.Dispatcher.BeginInvoke( () => { // once config is loaded, kick off the bootstrapper Bootstrapper bootstrapper = new Bootstrapper(); bootstrapper.Run(); // set the container Container = bootstrapper.Container; }); }; // call base to load configuration base.OnStartup(sender, e); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var bootstrapper = new Bootstrapper(); bootstrapper.Run(); }