예제 #1
0
        public RlStatsViewModelFixture()
        {
            _frontendRl = new HyperspinFrontend()
            {
                Executable      = "",
                HasSettingsFile = true,
                Path            = Environment.CurrentDirectory + "\\RocketLauncherData"
            };

            //Setup container and bootstrapper
            Bootstrapper    bs        = new Bootstrapper();
            IUnityContainer container = new UnityContainer();

            //Run bootstrapper to get the evtaggregator
            bs.Run();
            ea = ServiceLocator.Current.GetInstance <IEventAggregator>();

            //Register the Types needed and resolve
            container.RegisterType <IRocketLaunchStatProvider, RocketLaunchStatProvider>();
            container.RegisterType <ISettingsHypermint, SettingsRepo>();

            _statRepo    = container.Resolve <IRocketLaunchStatProvider>();
            settingsRepo = container.Resolve <ISettingsHypermint>();
            settingsRepo.HypermintSettings.RlPath = _frontendRl.Path;
        }
예제 #2
0
        public StatsViewModel(IRocketLaunchStatProvider statsRepo, IEventAggregator eventAggregator, ISettingsHypermint settingsRepo, IHyperspinManager hyperspinManager)
        {
            _statsRepo        = statsRepo;
            _eventAggregator  = eventAggregator;
            _settingsRepo     = settingsRepo;
            _hyperspinManager = hyperspinManager;

            //Updates the stats when system changed.
            _eventAggregator.GetEvent <SystemSelectedEvent>().Subscribe(async(x) => await UpdateStatsOnSystemChanged(x));
        }