Ejemplo n.º 1
0
        public MeasuresModule(IServiceLocator locator, IEventAggregator events)
        {
            _events = events;
            _events.GetEvent <MessageUpdateEvent>()
            .Publish(new MessageUpdateEvent()
            {
                Message = this.GetType().GetCustomAttribute <WingModuleAttribute>().Description
            });

            Application.Current.DoEvents();

            var regionManager = locator.GetInstance <IRegionManager>();
            var pluginTracker = locator.GetInstance <IPluginModuleTracker>();

            if (regionManager == null)
            {
                throw new NullReferenceException("regionManager should not be null.");
            }

            if (pluginTracker == null)
            {
                throw new NullReferenceException("pluginTracker should not be null.");
            }


            _regionManager = regionManager;
            _pluginTracker = pluginTracker;
            _pluginTracker.RecordModuleConstructed(this.GetType().Assembly.GetName().Name);
            _events.GetEvent <MessageUpdateEvent>()
            .Publish(new MessageUpdateEvent()
            {
                Message = string.Empty
            });
            Application.Current.DoEvents();
        }
        public DefaultModule(ILogWriter logger, IRegionManager regionManager, IPluginModuleTracker pluginTracker, IEventAggregator events)
        {
            Events = events;
            if (logger == null)
            {
                throw new NullReferenceException("logger of type \"ILoggerFacade\" is required and should not be null.");
            }

            if (regionManager == null)
            {
                throw new NullReferenceException("regionManager should not be null.");
            }

            if (pluginTracker == null)
            {
                throw new NullReferenceException("pluginTracker should not be null.");
            }
            _logger        = logger;
            _regionManager = regionManager;
            _pluginTracker = pluginTracker;
            _pluginTracker.RecordModuleConstructed(this.GetType().Assembly.GetName().Name);

            Events.GetEvent <PleaseStandByEvent>().Subscribe(payload =>
            {
                Events.GetEvent <ResumeNormalProcessingEvent>().Publish(Empty.Value);
                PleaseStandByHandler.Handle(payload);
            });
            Events.GetEvent <ResumeNormalProcessingEvent>().Subscribe(payload => ResumeNormalProcessingHandler.Handle(payload));
        }
Ejemplo n.º 3
0
        public WebsitesModule(IServiceLocator locator)
        {
            var logger        = locator.GetInstance <ILogWriter>();
            var regionManager = locator.GetInstance <IRegionManager>();
            var pluginTracker = locator.GetInstance <IPluginModuleTracker>();

            if (logger == null)
            {
                throw new NullReferenceException("logger of type \"ILoggerFacade\" is required and should not be null.");
            }

            if (regionManager == null)
            {
                throw new NullReferenceException("regionManager should not be null.");
            }

            if (pluginTracker == null)
            {
                throw new NullReferenceException("pluginTracker should not be null.");
            }

            _logger        = logger;
            _regionManager = regionManager;
            _pluginTracker = pluginTracker;
            _pluginTracker.RecordModuleConstructed(this.GetType().Assembly.GetName().Name);

            // Register the views in this module.
            //_regionManager.RegisterViewWithRegion("DataSetListView", typeof(Views.DataSetListView));
        }