/// <summary> /// Registration for this module. /// </summary> private void Registration() { _container.RegisterType <IGameService, FitnessTest.FitnessTestGameService>(); // Register our game number region _regionRegistry.RegisterViewWithRegion(RegionNames.GameNumberRegion, () => { IView view = _container.Resolve <GameNumberView>(); Presenter presenter = _container.Resolve <GameDataPresenter>(); view.ApplyPresenter(presenter); return(view); }); // Register our game round number region _regionRegistry.RegisterViewWithRegion(RegionNames.GameRoundRegion, () => { IView view = _container.Resolve <GameRoundView>(); Presenter presenter = _container.Resolve <GameDataPresenter>(); view.ApplyPresenter(presenter); return(view); }); // Register our config game number region _regionRegistry.RegisterViewWithRegion(RegionNames.ConfigGeneralOptionsRegion, () => { IView view = _container.Resolve <ConfigGameNumber>(); Presenter presenter = _container.Resolve <ConfigPresenter>(); view.ApplyPresenter(presenter); return(view); }); }
/// <summary> /// Called when [sensor registered]. /// </summary> /// <param name="sensorRegistrationData">The sensor registration data.</param> private void OnDeviceRegistered(ReceiverEvents.DeviceRegistered e) { lock (_sensorIds) { if (!_sensorIds.Contains(e.SensorId) && _sensorIds.Count < MAX_METERS) { _sensorIds.Add(e.SensorId); // NOTE: Use RegisterViewWithRegion not Add to region to fix issue with Telerik Control hanging _regionManager.RegisterViewWithRegion(RegionNames.MeterRegion, () => { using (new ShowBusyIndicator()) { IView view = _container.Resolve <MeterView>(); MeterPresenter presenter = _container.Resolve <MeterPresenter>(); presenter.Id = e.SensorId; presenter.SetMeterType(e.SensorType); presenter.RequestRemoval += (sender, args) => { lock (_sensorIds) { IRegion region = _regionManager.Regions[RegionNames.MeterRegion]; region.Remove(view); _sensorIds.Remove(presenter.Id); } }; view.ApplyPresenter(presenter); return(view); } }); } } }
/// <summary> /// Notifies the module that it has be initialized. /// </summary> public void Initialize() { _regionRegistry.RegisterViewWithRegion(RegionNames.ConfigGeneralOptionsRegion, () => { IView view = _container.Resolve <SockGloveModeView>(); Presenter presenter = _container.Resolve <ConfigPresenter>(); view.ApplyPresenter(presenter); return(view); }); _regionRegistry.RegisterViewWithRegion(RegionNames.ConfigGeneralOptionsRegion, () => { IView view = _container.Resolve <ConfigRequiredImpact>(); Presenter presenter = _container.Resolve <ConfigPresenter>(); view.ApplyPresenter(presenter); return(view); }); _regionRegistry.RegisterViewWithRegion(RegionNames.ConfigGeneralOptionsRegion, () => { IView view = _container.Resolve <RegisterDeviceView>(); Presenter presenter = _container.Resolve <ConfigPresenter>(); view.ApplyPresenter(presenter); return(view); }); //_regionRegistry.RegisterViewWithRegion(RegionNames.ConfigImpactRequiredRegion, () => //{ // IView view = _container.Resolve<ImpactRequiredView>(); // Presenter presenter = _container.Resolve<ConfigPresenter>(); // view.ApplyPresenter(presenter); // return view; //}); }
/// <summary> /// Registration for this module. /// </summary> private void Registration() { _container.RegisterType <SoundEffectsService>(new ContainerControlledLifetimeManager()); _container.RegisterType <SpeechService>(new ContainerControlledLifetimeManager()); _regionRegistry.RegisterViewWithRegion(RegionNames.ConfigGeneralOptionsRegion, () => { IView view = _container.Resolve <ConfigView>(); Presenter presenter = _container.Resolve <ConfigPresenter>(); view.ApplyPresenter(presenter); return(view); }); }
/// <summary> /// Notifies the module that it has be initialized. /// </summary> public void Initialize() { _container.RegisterType <RosterService>(new ContainerControlledLifetimeManager()); _eventAggregator.GetEvent <RosterEvents.ShowRosterPickList>().Subscribe(OnShowRosterPickList, ThreadOption.UIThread, true); _regionManager.RegisterViewWithRegion(RegionNames.RosterNamesRegion, () => { IView view = _container.Resolve <RosterView>(); Presenter presenter = _container.Resolve <RosterPresenter>(); view.ApplyPresenter(presenter); return(view); }); }
/// <summary> /// Registration for this module. /// </summary> private void Registration() { _container.RegisterType <DataLogModel>(new ContainerControlledLifetimeManager()); _container.RegisterType <DataLogService>(new ContainerControlledLifetimeManager()); _regionManager.RegisterViewWithRegion(RegionNames.HistoryGraphSelectors, () => { IView view = _container.Resolve <GameSelectorView>(); Presenter presenter = _container.Resolve <GameSelectorPresenter>(); view.ApplyPresenter(presenter); return(view); }); _regionManager.RegisterViewWithRegion(RegionNames.HistoryGraphMain, () => { IView view = _container.Resolve <GameImpactGraphView>(); Presenter presenter = _container.Resolve <GameImpactGraphPresenter>(); view.ApplyPresenter(presenter); return(view); }); }
/// <summary> /// Called when [meter show roster event handler]. /// </summary> /// <param name="sensorId">The sensor id.</param> private void OnShowRosterPickList(RosterEvents.ShowRosterPickList e) { _regionManager.RegisterViewWithRegion(RegionNames.OverlayRegion, () => { using (new ShowBusyIndicator()) { IView view = _container.Resolve <RosterNamesPopupView>(); RosterNamesPopupPresenter presenter = _container.Resolve <RosterNamesPopupPresenter>(); view.ApplyPresenter(presenter); presenter.RequestRemoval += (sender, args) => { if (e.ResultHandler != null && presenter.SelectedName != null) { e.ResultHandler.BeginInvoke(presenter.SelectedName.Name, null, null); } _regionManager.Regions[RegionNames.OverlayRegion].Remove(view); }; return(view); } }); }
/// <summary> /// Notifies the module to initialize itself. /// </summary> public void Initialize() { // Register presenters as singletons so we have only one even if there are multiple displays _container.RegisterType <CountDownClockPresenter>(new ContainerControlledLifetimeManager()); // Register our clock region _regionRegistry.RegisterViewWithRegion(RegionNames.ClockRegion, () => { IView view = _container.Resolve <CountDownClockView>(); Presenter presenter = _container.Resolve <CountDownClockPresenter>(); view.ApplyPresenter(presenter); return(view); }); // Register our clock config region _regionRegistry.RegisterViewWithRegion(RegionNames.ConfigGeneralOptionsRegion, () => { IView view = _container.Resolve <ConfigDurationView>(); Presenter presenter = _container.Resolve <ConfigPresenter>(); view.ApplyPresenter(presenter); return(view); }); }
/// <summary> /// Notifies the module that it has be initialized. /// </summary> public void Initialize() { // Register our services into the container _container.RegisterType <ReceiverService>(new ContainerControlledLifetimeManager()); _container.RegisterType <ReceiverStatePresenter>(new ContainerControlledLifetimeManager()); // Register our clock region _regionRegistry.RegisterViewWithRegion(RegionNames.ReceiverStateRegion, () => { IView view = _container.Resolve <ReceiverStateView>(); Presenter presenter = _container.Resolve <ReceiverStatePresenter>(); view.ApplyPresenter(presenter); return(view); }); // Schedule additional initializtion work to be done after all modules have initialized _eventAggregator.GetEvent <ProcessEvent>().Subscribe(new Action <ProcessEventType>(p => { if (p == ProcessEventType.ModulesInitialized) { OnModulesInitialized(); } }), true); }