Example #1
0
        /// <summary>
        /// On récupère les informations principales, dont les chemins (EBGame, TBGame)
        /// </summary>
        /// <param name="gamePath"></param>
        /// <param name="file"></param>
        /// <returns></returns>
        /// <remarks>
        /// Si les chemins sont vides, on conserve quand même pas de tri
        /// </remarks>
        private GamePaths GetMainsInfo(string gamePath, string file)
        {
            string xmlFile = Path.Combine(gamePath, file);

            GamePaths gpX = null;

            using (XML_Games xelGames = new XML_Games(xmlFile))
            {
                var xelG = xelGames.GetGameNode();

                gpX = GamePaths.CreateBasic(xelG);
                gpX.Complete(xelGames.GetNodes(Tag.AddApp, Tag.GameId, gpX.Id));

                // Essaie de récupération des paths
                foreach (var app in gpX.Applications)
                {
                    app.CurrentPath = SimuRelativePath(gpX.Platform, app.CurrentPath);
                }

                // ---
                gpX.ManualPath     = SimuRelativePath(gpX.Platform, gpX.ManualPath);
                gpX.MusicPath      = SimuRelativePath(gpX.Platform, gpX.MusicPath);
                gpX.VideoPath      = SimuRelativePath(gpX.Platform, gpX.VideoPath);
                gpX.ThemeVideoPath = SimuRelativePath(gpX.Platform, gpX.ThemeVideoPath);
            }

            return(gpX);
        }
Example #2
0
        private GamePaths MakeGamePaths(LBGame lbGame, GameDataCont gdC, Folder tree)
        {
            GamePaths gpX = GamePaths.CreateBasic(lbGame);

            //  gpX.ApplicationPath = AssignDefaultPath(tree.Children[Common.Games].Path, gdC.DefaultApp);
            gpX.SetApplications = gdC.Applications.Select(x =>
                                                          new DataPlus()
            {
                Id          = x.Id,
                Name        = x.Name,
                CurrentPath = x.Name,
                IsSelected  = x.IsSelected,
            });

            gpX.ManualPath     = AssignDefaultPath(tree.Children[Common.Manuals].Path, gdC.DefaultManual);
            gpX.MusicPath      = AssignDefaultPath(tree.Children[Common.Musics].Path, gdC.DefaultMusic);
            gpX.VideoPath      = AssignDefaultPath(tree.Children[Common.Videos].Path, gdC.DefaultVideo);
            gpX.ThemeVideoPath = AssignDefaultPath(tree.Children[Common.Videos].Path, gdC.DefaultThemeVideo);
            return(gpX);
        }