Example #1
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);
            }
        }
Example #2
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();
        }