コード例 #1
0
 private void AddAllGames()
 {
     if (_fileJSONService.appSettings.ShowAll == true)
     {
         var newsys = new Systeme();
         newsys.Name      = "Tous les Jeux";
         newsys.Shortname = "all";
         newsys.Type      = SysType.Collection;
         SystemeViewModel sysvm = new SystemeViewModel(newsys);
         sysvm.Bck = _themeService.GetBckForTheme(newsys.Shortname, _fileJSONService.GetCurrentTheme());
         var logopath = _themeService.GetLogoForTheme(newsys.Shortname);
         if (File.Exists(logopath))
         {
             sysvm.Logo    = logopath;
             sysvm.HasLogo = true;
         }
         Systemes.Insert(0, sysvm);
     }
 }
コード例 #2
0
 private void AddLastPlayed()
 {
     if (_fileJSONService.appSettings.ShowLastPlayed == true)
     {
         var newsys = new Systeme();
         newsys.Name      = "Derniers jeux joués";
         newsys.Shortname = "last";
         newsys.Type      = SysType.Collection;
         SystemeViewModel sysvm = new SystemeViewModel(newsys);
         sysvm.Bck = _themeService.GetBckForTheme(newsys.Shortname, _fileJSONService.GetCurrentTheme());
         var logopath = _themeService.GetLogoForTheme(newsys.Shortname);
         if (File.Exists(logopath))
         {
             sysvm.Logo    = logopath;
             sysvm.HasLogo = true;
         }
         Systemes.Insert(0, sysvm);
     }
 }
コード例 #3
0
 private void ReloadData()
 {
     Systemes = new ObservableCollection <SystemeViewModel>();
     foreach (var sys in _databaseService.GetSystemes().OrderBy(x => x.Name))
     {
         var sysvm = new SystemeViewModel(sys);
         sysvm.Bck = _themeService.GetBckForTheme(sys.Shortname, _fileJSONService.GetCurrentTheme());
         var logopath = _themeService.GetLogoForTheme(sys.Shortname);
         if (File.Exists(logopath))
         {
             sysvm.Logo    = logopath;
             sysvm.HasLogo = true;
         }
         sysvm.NBEmu  = $"{_databaseService.GetNbEmulatorForSysteme(sys.SystemeID)} Emulateurs";
         sysvm.NBGame = $"{_databaseService.GetNbGamesForPlateforme(sys.SystemeID)} Jeux";
         Systemes.Add(sysvm);
     }
     Systemes = new ObservableCollection <SystemeViewModel>(Systemes.OrderBy(x => x.Name));
     AddLastPlayed();
     AddMostPlayed();
     AddFavoriteGame();
     AddAllGames();
     //Systemes = new ObservableCollection<SystemeViewModel>(Systemes.OrderBy(x => x.Systeme.Type).ThenBy(x => x.Name));
 }