Example #1
0
 bool ExecuteAction(Action <ActionExecutionContext> originalInvokeAction,
                    ActionExecutionContext actionExecutionContext)
 {
     using (
         MainLog.Bench("UIAction",
                       actionExecutionContext.Target.GetType().Name + "." + actionExecutionContext.Method.Name)) {
         // TODO: This can deadlock ...
         // TODO: Don't use caliburn micro action handling, but use RXUI's task based Commands
         return
             (_exceptionHandler.TryExecuteAction(() => AsyncWrap(originalInvokeAction, actionExecutionContext))
              .Result);
     }
 }
Example #2
0
        void SetupGlobalServices()
        {
            // TODO: Get rid of this monstrosity.
            // Reason for being here: UserSettings.Current calls into a dialog
            // and global services are just horrible...
            using (MainLog.Bench(null, "SimpleInjector.AfterSetup")) {
                // Tsk
                AfterSetup();
                RegisterToolServices();
                SyncEvilGlobal.Setup(Container.GetInstance <EvilGlobalServices>(), () => 3); // todo
#if DEBUG
                // Creates an instance of every registered type, so better not use unless testing
                //_container.Verify();
#endif
            }
        }
Example #3
0
 public sealed override void OnStartup()
 {
     using (this.Bench()) {
         try {
             SetupContainer();
             SetupExceptionHandling();
             using (MainLog.Bench(null, "WpfAppBootstrapper.PreStart"))
                 PreStart();
             using (MainLog.Bench(null, "WpfAppBootstrapper.OnStartup"))
                 base.OnStartup();
         } catch (Exception ex) {
             LogError(ex, "Startup");
             throw;
         }
     }
 }