public RlAuditMediaViewModelBase(IEventAggregator ea, IHyperspinManager hyperspinManager, IGameLaunch gameLaunch, ISettingsHypermint settings, ISelectedService selected, IRlScan rlScan, IDialogCoordinator dialogService) { _eventAggregator = ea; _hyperspinManager = hyperspinManager; _selectedService = selected; _settings = settings; _dialogService = dialogService; _rlScan = rlScan; //Setup the games list. GamesList = new ListCollectionView(_hyperspinManager.CurrentSystemsGames); GamesList.CurrentChanged += GamesList_CurrentChanged; CurrentCellChanged = new DelegateCommand <object>(selectedGameCell => { OnCurrentCellChanged(selectedGameCell); }); ScanRlMediaCommand = new DelegateCommand(async() => await ScanForMedia()); LaunchRlMode = new DelegateCommand <string>((x) => { gameLaunch.RocketLaunchGameWithMode( settings.HypermintSettings.RlPath, selected.CurrentSystem, selected.CurrentRomname, x); }); OpenScanRocketMediaFolderCommand = new DelegateCommand <string>(OpenScanRocketMediaFolderAsync); }
public MultiSystemViewModel(IEventAggregator ea, IFileDialogHelper fileService, IDialogCoordinator dialogService, IHyperspinManager hyperspinManager, ISettingsHypermint settings, ISelectedService selectedService, ILoggerFacade loggerFacade) : base(loggerFacade) { _eventAggregator = ea; _fileFolderService = fileService; _settingsService = settings; _dialogService = dialogService; _hyperspinManager = hyperspinManager; _selectedService = selectedService; MultiSystemList = new ListCollectionView(_hyperspinManager.MultiSystemGamesList); _eventAggregator.GetEvent <AddToMultiSystemEvent>().Subscribe(AddToMultiSystem); _eventAggregator.GetEvent <BuildMultiSystemEvent>().Subscribe((x) => OpenBuildMultiSystemDialog()); _eventAggregator.GetEvent <ScanMultiSystemFavoritesEvent>().Subscribe(async(x) => await ScanFavoritesAsync()); //Commands RemoveGameCommand = new DelegateCommand <GameItemViewModel>(RemoveFromMultisystemList); //OpenSearchCommand = new DelegateCommand<string>(async x => //{ // await RunCustomDialog(); //}); //Used for the save dialog CloseCommand = new DelegateCommand(async() => { await _dialogService.HideMetroDialogAsync(this, customDialog); }); SelectionChanged = new DelegateCommand <IList>(items => { OnMultipleItemsSelectionChanged(items); }); }
public SystemsViewModel(IHyperspinManager hyperspinManager, IHyperspinXmlDataProvider hsDataProvider, IEventAggregator eventAggregator, ISettingsHypermint settings, IDialogCoordinator dialogService, ISelectedService selectedService) { _eventAggregator = eventAggregator; _settingsRepo = settings; _selectedService = selectedService; _dialogService = dialogService; _hyperspinManager = hyperspinManager; // Setup the main menu database to read in all systems _mainMenuXmlPath = ""; _mainMenuXmlPath = Path.Combine( _settingsRepo.HypermintSettings.HsPath, Root.Databases, @"Main Menu\Main Menu.xml"); SystemItems = new ListCollectionView(_hyperspinManager.Systems); SystemItems.CurrentChanged += SystemItems_CurrentChanged; //When main menu is selected _eventAggregator.GetEvent <MainMenuSelectedEvent>().Subscribe(async x => { await OnMainMenuSelected(x); }); _eventAggregator.GetEvent <SystemFilteredEvent>().Subscribe(FilterSystemsByText); _eventAggregator.GetEvent <ReorderingSystemsEvent>().Subscribe(x => ReOrderSystems = x); _eventAggregator.GetEvent <NewSystemCreatedEvent>().Subscribe(OnSystemCreated); //UpdateSystemsAsync(_mainMenuXmlPath); //_eventAggregator.GetEvent<AddNewSystemEvent>().Publish("SystemsView"); }
public GamesListDataGridViewModel(IEventAggregator eventAggregator, IHyperspinManager hyperspinManager, ISelectedService selectedService) { _eventAggregator = eventAggregator; _hyperspinManager = hyperspinManager; _selectedService = selectedService; //Set to the main menu games list _selectedService.CurrentSystem = "Main Menu"; _selectedService.SelectedGames = new List <GameItemViewModel>(); SelectionChanged = new DelegateCommand <IList>(items => { OnMultipleItemsSelectionChanged(items); }); //Set the observable game to a collection for the view. GamesList = new ListCollectionView(_hyperspinManager.CurrentSystemsGames); GamesList.CurrentChanged += GamesList_CurrentChanged; //Games = _hyperspinManager.CurrentSystemsGames; _eventAggregator.GetEvent <GameFilteredEvent>().Subscribe(FilterGamesByText); _eventAggregator.GetEvent <SystemDatabaseChanged>().Subscribe(SystemDatabaseChangedHandler); _eventAggregator.GetEvent <SystemSelectedEvent>().Subscribe(UpdateGamesAsync); _eventAggregator.GetEvent <UserRequestUpdateSelectedRows>().Subscribe((x) => UpdateSelectedRows(x)); Load(); }
public SaveDatabaseDialogViewModel(ISettingsHypermint settingsRepo, IHyperspinManager hyperspinManager, IHyperspinXmlDataProvider dataProvider, ISelectedService selectedService, IDialogCoordinator dialogService, IEventAggregator ea) { _settingsRepo = settingsRepo; _selectedService = selectedService; _eventAggregator = ea; _dialogService = dialogService; _hyperspinManager = hyperspinManager; SaveOptions = new SaveOptions(); //Commands SaveXmlCommand = new DelegateCommand(async() => { await SaveDatabaseConfirmAsync(SaveOptions.DbName); }); CloseCommand = new DelegateCommand(async() => { await _dialogService.HideMetroDialogAsync(this, customDialog); }); //Events _eventAggregator.GetEvent <SystemSelectedEvent>().Subscribe(sysName => { SaveOptions.DbName = sysName; }); _eventAggregator.GetEvent <SystemDatabaseChanged>().Subscribe(sysName => { SaveOptions.DbName = sysName; }); }
//IAuditer auditer #region Constructor public HsMediaAuditViewModel(ISettingsHypermint settings, IHyperspinManager hsManager, IEventAggregator eventAggregator, IDialogCoordinator dialogService, ISelectedService selectedService, IGameLaunch gameLaunch, ISearchYoutube youtube) : base(eventAggregator, selectedService, gameLaunch, settings) { _youtube = youtube; _dialogService = dialogService; _hyperspinManager = hsManager; CurrentCellChanged = new DelegateCommand <object>(selectedGameCell => { SelectedGameCellChanged(selectedGameCell); }); SearchYoutubeCommand = new DelegateCommand(() => { _eventAggregator.GetEvent <GetVideosEvent>().Publish(new object()); _eventAggregator.GetEvent <NavigateRequestEvent>().Publish("YoutubeView"); }); // Runs the auditer for hyperspin RunAuditCommand = new DelegateCommand(async() => await RunScan()); _eventAggregator.GetEvent <HsAuditUpdateEvent>().Subscribe(a => { OnHsAuditUpdateEvent(a); }); //Set the observable game to a collection for the view. GamesList = new ListCollectionView(_hyperspinManager.CurrentSystemsGames); GamesList.CurrentChanged += GamesList_CurrentChanged; //GamesList.GroupDescriptions.Add(new PropertyGroupDescription("RomName")); _eventAggregator.GetEvent <GamesUpdatedEvent>().Subscribe(GamesUpdated); }
public AddSystemDialogViewModel(IDialogCoordinator dialogService, CustomDialog callingDialog, IHyperspinManager manager, IEventAggregator ea, IFileDialogHelper fileFolderServic, ISettingsHypermint settings, ISelectedService service) { _dialogService = dialogService; _hyperspinManager = manager; _callingDialog = callingDialog; _eventAggregator = ea; _fileFolderServic = fileFolderServic; _settings = settings; _service = service; CloseDialogCommand = new DelegateCommand(async() => { await _dialogService.HideMetroDialogAsync(this, callingDialog); }); SelectDatabaseCommand = new DelegateCommand(() => { OnSelectDatabase(); }); SaveNewSystemCommand = new DelegateCommand(() => { OnSaveNewSystem(); }); }
public SidebarViewModel(IEventAggregator eventAggregator, ISettingsHypermint settings, ISelectedService selectedService, IHyperspinManager hyperManager) { _settingsRepo = settings; _eventAggregator = eventAggregator; _selectedService = selectedService; _hyperManager = hyperManager; }
public DatabaseDetailsViewModel(ISelectedService selectedService, IEventAggregator eventAggregator, IDialogCoordinator dialogService, IHyperspinManager hyperspinManager) { _eventAggregator = eventAggregator; _dialogService = dialogService; _hyperspinManager = hyperspinManager; _selectedService = selectedService; _eventAggregator.GetEvent <GameSelectedEvent>().Subscribe(UpdateHeader); }
/// <summary> /// This view model applies the given value to multiple rows /// </summary> /// <param name="selectedService">The selected service.</param> /// <param name="ea">The ea.</param> public DatabaseOptionsViewModel(IHyperspinManager hyperspinManager, ISelectedService selectedService, IEventAggregator ea) { _selectedService = selectedService; _eventAggregator = ea; _hyperspinManager = hyperspinManager; ApplyToCellsCommand = new DelegateCommand(ApplyToCells); ReplaceDescriptionCommand = new DelegateCommand(ReplaceDescriptions); }
public RlDefaultAuditViewModel(IEventAggregator ea, IHyperspinManager hyperspinManager, IGameLaunch gameLaunch, ISettingsHypermint settings, ISelectedService selected, IRlScan rlScan, IDialogCoordinator dialogService) : base(ea, hyperspinManager, gameLaunch, settings, selected, rlScan, dialogService) { _rlScan = rlScan; _settings = settings; _selected = selected; DefaultFolders = new ObservableCollection <RlAudit>(); ScanDefaultsCommand = new DelegateCommand(async() => await ScanForMedia()); }
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)); }
public SearchViewModel( IEventAggregator eventAggregator, ISettingsHypermint settings, ISelectedService selectedSrv, IHyperspinManager hyperspinManager, IGameLaunch gameLaunch) : base(eventAggregator, selectedSrv, gameLaunch, settings) { _hyperspinManager = hyperspinManager; Systems = new ListCollectionView(_hyperspinManager.Systems); DockSystemsCommand = new DelegateCommand(() => { SystemsVisible = !SystemsVisible; }); SelectSystemsCommand = new DelegateCommand <string>(OnSystemsSelected); }
public ShellViewModel(ILoggerFacade loggerFacade, IRegionManager regionManager, IEventAggregator eventAggregator, ISelectedService service, IHyperspinManager hsManager, ISettingsHypermint settings) : base(loggerFacade) { _regionManager = regionManager; _hsManager = hsManager; _service = service; LoadSettings(settings); NavigateCommand = new DelegateCommand <string>(Navigate); //TODO: Remove this and all subscribers and replace with logging. eventAggregator.GetEvent <ErrorMessageEvent>().Subscribe(DisplayError); }
public MultiSystemControlPanelViewModel(IEventAggregator ea, IHyperspinManager hyperspinManager) { _eventAggregator = ea; _hyperspinManager = hyperspinManager; ClearListCommand = new DelegateCommand(() => { if (_hyperspinManager.MultiSystemGamesList != null) { _hyperspinManager.MultiSystemGamesList.Clear(); } }); BuildMultiSystemCommand = new DelegateCommand(() => _eventAggregator.GetEvent <BuildMultiSystemEvent>().Publish(true)); ScanFavoritesCommand = new DelegateCommand(() => _eventAggregator.GetEvent <ScanMultiSystemFavoritesEvent>().Publish(true)); }
public DatabasePickerViewModel(IEventAggregator eventAggregator, IHyperspinManager hyperspinManager, ISettingsHypermint settingsRepo, ISelectedService selectedService) { _eventAggregator = eventAggregator; _hyperspinManager = hyperspinManager; _settingsRepo = settingsRepo; _selectedService = selectedService; this.SystemDatabases = new ListCollectionView(_hyperspinManager.DatabasesCurrentSystem); this.GenreDatabases = new ListCollectionView(_hyperspinManager.DatabasesCurrentGenres); OpenFolderCommand = new DelegateCommand <string>(OpenFolder); SystemDatabases.CurrentChanged += SystemDatabases_CurrentChanged; _eventAggregator.GetEvent <SystemSelectedEvent>().Subscribe(async(x) => await OnSystemChanged(x)); }
public SidebarOptionsViewModel(IHyperspinManager hyperSpinManager, IHyperspinXmlDataProvider dataProvider, ISelectedService selected, ISettingsHypermint settings, IEventAggregator ea, IDialogCoordinator dialogService, IFileDialogHelper fileFolderServic) { _hyperSpinManager = hyperSpinManager; _dataProvider = dataProvider; _dialogService = dialogService; _eventAggregator = ea; _selected = selected; _fileFolderServic = fileFolderServic; _settings = settings; AddSystemCommand = new DelegateCommand <string>(async x => { await OnAddSystem(); }); SaveMainMenuCommand = new DelegateCommand(async() => await SaveMainMenu()); }
public MainMenuViewModel(ISettingsHypermint settingsRepo, IEventAggregator ea, IHyperspinManager hyperspinManager, ISelectedService selectedService, IHyperspinXmlDataProvider dataProvider) { _settingsRepo = settingsRepo; _selectedService = selectedService; _eventAggregator = ea; _dataProvider = dataProvider; _hyperspinManager = hyperspinManager; //Init the collections used MainMenuItemViewModels = new ObservableCollection <MainMenuItemViewModel>(); SelectedMainMenuItem = new MainMenuItemViewModel(); MainMenuDatabases = new ListCollectionView(MainMenuItemViewModels); MainMenuDatabases.CurrentChanged += MainMenuDatabases_CurrentChanged; OpenFolderCommand = new DelegateCommand <string>(OnOpenDirectory); SetMainMenuDatabases("Main Menu"); }
public SearchResultsViewModel(IEventAggregator ea, ISettingsHypermint settingsRepo, ISelectedService selectedSvc, IHyperspinXmlDataProvider hsXmlPRovider, IHyperspinManager hyperspinManager) { _ea = ea; _settingsRepo = settingsRepo; _selectedSvc = selectedSvc; _hsXmlPRovider = hsXmlPRovider; _hyperspinManager = hyperspinManager; SearchGames = new ObservableCollection <GameSearch>(); FoundGames = new ListCollectionView(SearchGames); PageGamesCommand = new DelegateCommand <string>(x => PageGames(x)); //Scan games on this event _ea.GetEvent <OnSearchForGames>().Subscribe(searchOptions => ScanForGamesAsync(searchOptions)); SelectionChanged = new DelegateCommand <IList>(items => { OnMultipleItemsSelectionChanged(items); }); }
public DatabaseControlsViewModel(IEventAggregator eventAgg, IUnityContainer container, ISettingsHypermint settings, IHyperspinManager hsManager, ISelectedService selectedService, IDialogCoordinator dialogService) { _hyperspinManager = hsManager; _eventAgg = eventAgg; _selectedService = selectedService; _dialogService = dialogService; _container = container; _settings = settings; EnableFaveItemsCommand = new DelegateCommand <string>(x => UpdateRows(x, RowUpdateType.Favorite)); EnableDbItemsCommand = new DelegateCommand <string>(x => UpdateRows(x, RowUpdateType.Enabled)); OpenSaveDialogCommand = new DelegateCommand <string>(async x => { await RunCustomDialog(); }); ScanRomsCommand = new DelegateCommand(async() => await ScanRomsFromRocketLauncherDirsAsync()); }
public SaveMultiSystemViewModel(IDialogCoordinator dialogService, CustomDialog customDialog, IEventAggregator ea, ISettingsHypermint settingsService, IHyperspinManager hyperspinManager, IFileDialogHelper fileService, ISelectedService selected, ILoggerFacade loggerFacade) : base(loggerFacade) { _dialogService = dialogService; _customDialog = customDialog; _eventAggregator = ea; _settingsService = settingsService; _fileFolderService = fileService; _hyperspinManager = hyperspinManager; CloseCommand = new DelegateCommand(async() => { await _dialogService.HideMetroDialogAsync(this, _customDialog); }); SelectSettingsCommand = new DelegateCommand(SelectSettings); BuildMultiSystemCommand = new DelegateCommand(async() => { try { if (CheckValid()) { await BuildMultiSystemAsync(); Log("Saving MS to xmls"); await _hyperspinManager.SaveCurrentSystemsListToXmlAsync(selected.CurrentMainMenu, true); Log("Completed"); await _dialogService.HideMetroDialogAsync(this, _customDialog); } } catch (Exception ex) { Log(ex.Message, Category.Warn); await _dialogService.HideMetroDialogAsync(this, _customDialog); } } ); }
public RlMediaAuditViewModel(IEventAggregator evtAggregator, ISelectedService selectedService, IGameLaunch gameLaunch, ISettingsHypermint settingsRepo, IHyperspinManager hyperspinManager) : base(evtAggregator, selectedService, gameLaunch, settingsRepo) { GamesList = new ListCollectionView(hyperspinManager.CurrentSystemsGames); GamesList.CurrentChanged += GamesList_CurrentChanged; }
public HyperspinFilesViewModel(IEventAggregator ea, ISettingsHypermint settings, IRegionManager regionManager, ITrashMaster trashMaster, ISelectedService selectedService, IImageEditService imageEdit, IHyperspinManager hyperspinManager) { _eventAggregator = ea; _settingsRepo = settings; _selectedService = selectedService; _imageEdit = imageEdit; _regionManager = regionManager; _trashMaster = trashMaster; _hyperspinManager = hyperspinManager; CurrentMediaFiles = new ObservableCollection <MediaFile>(); FilesForGame = new ListCollectionView(CurrentMediaFiles); FilesForGame.CurrentChanged += FilesForGame_CurrentChanged; _eventAggregator.GetEvent <GameSelectedEvent>().Subscribe((x) => { try { string activeViewName = RegionHelper.GetCurrentViewName(_regionManager); //if (!activeViewName.Contains("HsMediaAuditView") || !activeViewName.Contains("DatabaseDetailsView")) SetCurrentName(x); if (FilesForGame != null) { if (FilesForGame.CurrentItem == null) { _eventAggregator.GetEvent <PreviewGeneratedEvent>().Publish(""); } else { FilesForGame_CurrentChanged(null, null); } } } catch (Exception ex) { } }, ThreadOption.UIThread); _eventAggregator.GetEvent <SystemSelectedEvent>().Subscribe((x) => { UnusedMediaFiles = null; CurrentMediaFiles.Clear(); }); //_eventAggregator.GetEvent<AuditHyperSpinEndEvent>().Subscribe(BuildUnusedMediaList); RemoveFileCommand = new DelegateCommand(() => { var currentFile = FilesForGame.CurrentItem as MediaFile; if (currentFile != null) { _eventAggregator.GetEvent <PreviewGeneratedEvent>().Publish(""); _trashMaster.HsFileToTrash(currentFile.FileName, GetSystemFolderName(columnHeader), columnHeader, _selectedService.CurrentRomname); try { SetCurrentName(new string[] { _selectedService.CurrentRomname, columnHeader }); _eventAggregator.GetEvent <RefreshHsAuditEvent>().Publish(""); } catch (Exception) { } } }); OpenFolderCommand = new DelegateCommand(OpenFolder); OpenTrashFolderCommand = new DelegateCommand(() => { var sys = GetSystemFolderName(columnHeader); var result = new DirectoryInfo(_trashMaster.GetHsTrashPath(sys, columnHeader)).Open(); }); }
public WheelProcessViewModel(ITextImageService textImageService, IEventAggregator ea, ISelectedService selectedService, IHyperspinManager hyperspinManager, ISettingsHypermint settings) { _eventAgg = ea; _selectedService = selectedService; _hyperspinManager = hyperspinManager; _settings = settings; _textImageService = textImageService; PresetsUpdated(""); ProcessWheelsCommand = new DelegateCommand(async() => { if (_hyperspinManager.CurrentSystemsGames != null) { Cancellable = true; if (ProcessWheels) { await ProcessWheelsAsync(); } else if (ProcessLetters) { await ProcessLettersAsync(); } else if (ProcessGenres) { await ProcessGenresAsync(); } } }); ProcessCancelCommand = new DelegateCommand(() => { Cancellable = false; ProcessCancel = true; }); GeneratePreviewCommand = new DelegateCommand(GeneratePreview); OpenExportFolderCommand = new DelegateCommand(() => { var exportPath = GetSystemsWheelExportPath("Wheels"); if (ProcessLetters) { exportPath = GetSystemsWheelExportPath("Letters"); } else if (ProcessGenres) { exportPath = GetSystemsWheelExportPath("Genres"); } var result = new DirectoryInfo(exportPath).Open(); }); _eventAgg.GetEvent <PresetWheelsUpdatedEvent>().Subscribe(x => { PresetsUpdated(x); }); }
public HypermintFakeFixture() { _settingsRepo = A.Fake <SettingsRepo>(); _hyperManager = A.Fake <HyperspinManager>(); }
public RlFadeAuditViewModel(IEventAggregator ea, IHyperspinManager hyperspinManager, IGameLaunch gameLaunch, ISettingsHypermint settings, ISelectedService selected, IRlScan rlScan, IDialogCoordinator dialogService) : base(ea, hyperspinManager, gameLaunch, settings, selected, rlScan, dialogService) { _rlScan = rlScan; _settings = settings; }