コード例 #1
0
        private void RunMainView()
        {
            var mainView = ServiceLocationContainer.Resolve <IMainView>();

            mainView.Loaded += mainViewLoaded;
            mainView.Closed += mainViewClosed;
            mainView.Run();
        }
コード例 #2
0
 private void mainViewLoaded(object sender, EventArgs e)
 {
     if (ServiceLocationContainer.CanResolve <ISplashScreen>())
     {
         ServiceLocationContainer.Resolve <ISplashScreen>().Close();
     }
     uiWaitHandle.Set();
 }
コード例 #3
0
 protected override void ExecuteAction(IAction action, ActionExecutionContext context)
 {
     if (action is IUiAction)
     {
         var syncContext = ServiceLocationContainer.Resolve <ISynchronizationContextManager>();
         syncContext.Execute(action, context);
     }
     else
     {
         action.Execute(context);
     }
 }
コード例 #4
0
        private void StartUI()
        {
            if (ServiceLocationContainer.CanResolve <ISplashScreen>())
            {
                ServiceLocationContainer.Resolve <ISplashScreen>().Show();
            }

            if (ServiceLocationContainer.CanResolve <IUiApplicationBehavior>())
            {
                ServiceLocationContainer.Resolve <IUiApplicationBehavior>()
                .Initialize();
            }

            CheckApplicationResources();
            RunMainView();
        }
コード例 #5
0
        protected virtual void CheckApplicationResources()
        {
            var resourceCheckers = ServiceLocationContainer.ResolveAbsolutelyAll <IApplicationResource>();

            foreach (var resource in resourceCheckers)
            {
                if (!resource.CheckAvailability())
                {
                    if (resource.HasUI && ServiceLocationContainer.CanResolve <ISplashScreen>())
                    {
                        ServiceLocationContainer.Resolve <ISplashScreen>().Close();
                    }
                    resource.MakeAvailable();
                }
            }
        }