Пример #1
0
        internal AppStateManager(AppState parentState, AppStateManager parentStateManager)
        {
            Debug.Assert(parentState != null);
            Debug.Assert(parentStateManager != null);

            _console = parentStateManager._console;
            _synchronizationContext = parentStateManager._synchronizationContext;
            _controllerFactory      = parentStateManager._controllerFactory;
            _viewManager            = parentStateManager._viewManager;
            _parentState            = parentState;
            _parentStateManager     = parentStateManager;
            _serviceProvider        = parentStateManager._serviceProvider;
        }
Пример #2
0
        internal AppStateManager(SynchronizationContext syncContext,
                                 IAppStateControllerFactory controllerFactory,
                                 IAppViewFactory viewManager,
                                 IServiceProvider services)
        {
            Debug.Assert(controllerFactory != null);
            Debug.Assert(viewManager != null);
            Debug.Assert(services != null);

            _console = new TraceSource(_serviceName);
            _synchronizationContext = syncContext;
            _controllerFactory      = controllerFactory;
            _viewManager            = viewManager;
            _serviceProvider        = services;
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        public static IAppStateService CreateStateManager(SynchronizationContext syncContext, IAppStateControllerFactory controllerFactory, IAppViewFactory viewFactory, IServiceProvider serviceProvider)
        {
            if (controllerFactory == null)
            {
                throw new ArgumentNullException(nameof(controllerFactory));
            }

            if (viewFactory == null)
            {
                throw new ArgumentNullException(nameof(viewFactory));
            }

            if (serviceProvider == null)
            {
                throw new ArgumentNullException(nameof(serviceProvider));
            }

            return(new AppStateManager(syncContext, controllerFactory, viewFactory, serviceProvider));
        }