Ejemplo n.º 1
0
 public static string AndriodVerPath()
 {
     return(Application.dataPath.PathFormat()
            .PathCombine(C_PathConfig.ServerResDirName)
            .PathCombine(C_Platform.GetName(1))
            .PathCombine(C_PathConfig.VerFileName)
            );
 }
Ejemplo n.º 2
0
        internal void EditPlatform()
        {
            try
            {
                //PreviousPlatformState = SelectedPlatform;
                // Cliché des dossiers
                CBAckupPlatform =
                    C_Platform.Platform_Maker(SelectedPlatform, SelectedPlatform.GetAllPlatformFolders());

                // Lancement de la modification des paths
                W_PlatformPaths wPP = new W_PlatformPaths()
                {
                    Model = new PlatformModel(SelectedPlatform.Name)
                };

                if (wPP.ShowDialog() != true)
                {
                    return;
                }

                // Rafraichissement
                if (!Global.DebugMode)// && !wp.Model.PlatformObject.Folder.Equals(oldPath))
                {
                    Initialize();

                    //SelectedPlatform = PluginHelper.DataManager.GetPlatformByName(CBAckupPlatform.PlatformName);
                }

                if (!CBAckupPlatform.ApplicationPath.OldPath.Equals(SelectedPlatform.Folder) &&
                    DxMBox.ShowDial(SPRLang.QChange_GamesPaths, "Question", E_DxButtons.No | E_DxButtons.Yes) == true)
                {
                    W_GamePaths wp = new W_GamePaths()
                    {
                        Model = new GamePathsModel(SelectedPlatform, CBAckupPlatform?.PlatformName),
                    };
                    wp.ShowDialog();
                }
            }

            catch (Exception exc)
            {
                DxMBox.ShowDial(exc.Message);
                HeTrace.WriteLine(exc.Message);
                HeTrace.WriteLine(exc.StackTrace);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// (Re)Initialize les paths
        /// </summary>
        private void InitializePaths()
        {
            HeTrace.WriteLine("Paths initialization", 5);

            // Initialization according to the mode (debug/plugin)
            if (Global.DebugMode)
            {
                // Utilisation de pseudos dossiers
                _PlatformFolders = ((MvPlatform)PlatformObject).GetAllPlatformFolders();
            }
            else
            {
                // Récupération de tous les dossiers + tri
                _PlatformFolders = PlatformObject.GetAllPlatformFolders()
                                   .OrderBy(x => x.MediaType).ToArray();
            }

            //
            HeTrace.WriteLine($"Dossier de jeu: {PlatformObject.Folder}");
            C_Platform tmp = C_Platform.Platform_Maker(PlatformObject, _PlatformFolders);

            PlatformPaths = tmp;
            GC.Collect();
        }
Ejemplo n.º 4
0
        public MigrateLModel(C_Platform backupPlatform, IPlatform currentPlatform)
        {
            CurrentPlatform = currentPlatform;
            ///OldPlatform = oldPlatform;
            VisPlatform = backupPlatform;


            //HeTrace.WriteLine($"Old Platform path '{oldPlatform.app}'");
            HeTrace.WriteLine($"Current Platform path '{CurrentPlatform.Folder}'");


            //VisPlatform = C_Platform.Platform_Maker(oldPlatform, oldPlatform.GetAllPlatformFolders());

            VisPlatform.ApplicationPath.NewRelatPath = currentPlatform.Folder;
            VisPlatform.ApplicationPath.NewHardPath  = Path.GetFullPath(currentPlatform.Folder, Global.LaunchBoxRoot);

            foreach (var elem in VisPlatform)
            {
                foreach (var elem2 in currentPlatform.GetAllPlatformFolders())
                {
                    if (elem2.MediaType.Equals(elem.Type))
                    {
                        elem.NewHardPath  = Path.GetFullPath(elem2.FolderPath, Global.LaunchBoxRoot);
                        elem.NewRelatPath = DxPath.To_RelativeOrNull(Global.LaunchBoxRoot, elem.NewHardPath);
                    }
                }
            }


            /*Platform_Tools.SetFolders(in oldPlatform);
             *
             * Platform_Tools.SetFolders(in currentPlatform);*/
            //oldPlatform.

            //HeTrace.WriteLine($"default boximagepath '{oldPlatform.DefaultBoxImagePath}'");


            // Initialization des dossiers
            // Initialization according to the mode (debug/plugin)

            /*if (Global.DebugMode)
             *  // Utilisation de pseudos dossiers
             *  _PlatformFolders = ((MvPlatform)PlatformObject).GetAllPlatformFolders();
             * else
             *  // Récupération de tous les dossiers + tri
             *  _PlatformFolders = PlatformObject.GetAllPlatformFolders()
             *                          .OrderBy(x => x.MediaType).ToArray();*/

            // Games

            /*            GamesPaths.Source = oldPlatform.Folder;
             *          GamesPaths.Destination = currentPlatform.Folder;
             *          HeTrace.WriteLine(oldPlatform.Folder, 5);
             *          HeTrace.WriteLine(currentPlatform.Folder, 5);
             *
             *          /*  // Images
             *            ImagesPaths.Source = Path.GetDirectoryName(OldPlatform.DefaultBoxImagePath);
             *            ImagesPaths.Destination = Path.GetDirectoryName(CurrentPlatform.DefaultBoxImagePath);*/
            // Manuals

            /*     ManualsPaths.Source = oldPlatform.ManualsFolder;
             *   ManualsPaths.Destination = currentPlatform.ManualsFolder;
             *   // Musics
             *   MusicsPaths.Source = oldPlatform.MusicFolder;
             *   MusicsPaths.Destination = currentPlatform.MusicFolder;
             *   // Videos
             *   VideosPaths.Source = oldPlatform.VideosFolder;
             *   VideosPaths.Destination = currentPlatform.VideosFolder;*/
        }