Example #1
0
        // ---

        public override bool ExportGames(ICollection <DataRep> games)
        {
            bool result = false;

            try
            {
                MeEmit mee = new MeEmit()
                {
                    ByPass = true,
                };
                mee.SignalWrite     += (x, y) => this.SetStatus(x, new StateArg(y, false));
                mee.SignalWriteLine += (x, y) => this.SetStatus(x, new StateArg(y, false));
                HeTrace.AddMessenger("Mee", mee);

                foreach (var game in games)
                {
                    //string tmpPath = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(game.Name));

                    ExportGame(game.CurrentPath);
                }
                result = true;
            }

            catch (Exception exc)
            {
                HeTrace.WriteLine(exc.Message);
                HeTrace.WriteLine(exc.StackTrace);
                result = false;
            }
            finally
            {
                HeTrace.RemoveMessenger("Mee");
            }
            return(result);
        }
Example #2
0
        internal bool InjectGamesFo(ICollection <DataRep> games)
        {
            bool result = false;

            try
            {
                MeEmit mee = new MeEmit()
                {
                    ByPass = true,
                };
                mee.SignalWrite     += (x, y) => this.SetStatus(x, new StateArg(y, false));
                mee.SignalWriteLine += (x, y) => this.SetStatus(x, new StateArg(y, false));
                HeTrace.AddMessenger("Mee", mee);

                foreach (var game in games)
                {
                    InjectGame(game.CurrentPath);
                }

                result = true;
            }
            catch (Exception exc)
            {
                HeTrace.WriteLine(exc.Message);
                HeTrace.WriteLine(exc.StackTrace);
                result = false;
            }
            finally
            {
                HeTrace.RemoveMessenger("Mee");
            }
            return(result);
        }
Example #3
0
        public DPGMakerCore()
        {
            MeEmit mee = new MeEmit()
            {
                ByPass = true,
            };

            mee.SignalWrite     += (x, y) => this.SetStatus(x, new StateArg(y, false));
            mee.SignalWriteLine += (x, y) => this.SetStatus(x, new StateArg(y, false));
            HeTrace.AddMessenger("Mee", mee);
        }
Example #4
0
        internal bool InjectGamesFi(ICollection <DataRep> games)
        {
            ProgressTotal = games.Count();
            try
            {
                MeEmit mee = new MeEmit()
                {
                    ByPass = true,
                };
                mee.SignalWrite     += (x, y) => this.SetStatus(x, new StateArg(y, false));
                mee.SignalWriteLine += (x, y) => this.SetStatus(x, new StateArg(y, true));
                HeTrace.AddMessenger("Mee", mee);

                List <DataRep> folders = new List <DataRep>();

                // Extraction des données
                foreach (DataRep game in games)
                {
                    string tmpPath = Path.Combine(Config.HWorkingFolder, Path.GetFileNameWithoutExtension(game.Name));
                    game.DestPath = tmpPath;

                    // extraction
                    ExtractDataFiles(game, tmpPath);

                    folders.Add(new DataRep(tmpPath));
                }

                // Exportation
                foreach (DataRep game in games)
                {
                    InjectGame(game.DestPath);
                }

                return(true);
            }
            catch (Exception exc)
            {
                HeTrace.WriteLine(exc.Message);
                HeTrace.WriteLine(exc.StackTrace);
                return(false);
            }
            finally
            {
                HeTrace.RemoveMessenger("Mee");
            }
        }
Example #5
0
        /// <summary>
        /// Sert au traitement de packaging pour un jeu
        /// </summary>
        /// <param name="iD"></param>
        /// <param name="platformName"></param>
        public LaunchBoxCore(string platformName)
        {
            if (string.IsNullOrEmpty(platformName))
            {
                throw new Exception();
            }


            //_PlatformName = platformName;

            #region Initialisation des chemins
            _WFolder = Config.HWorkingFolder;
            // Chemin du dossier temporaire du system
            _SystemPath = Path.Combine(_WFolder, platformName);

            #endregion

            _XMLPlatformFile = Path.Combine(Config.HLaunchBoxPath, Config.PlatformsFolder, $"{platformName}.xml");
            _ZePlatform      = XML_Platforms.GetPlatformPaths(Path.Combine(Config.HLaunchBoxPath, Config.PlatformsFile), platformName);


            #region Messages
            MeDebug mdb = new MeDebug()
            {
                ByPass = true,
            };
            HeTrace.AddMessenger("Debug", mdb);

            // Réorientation via les signaux
            MeEmit mdE = new MeEmit()
            {
                ByPass = true,
            };
            HeTrace.AddMessenger("Signal", mdE);
            mdE.SignalWrite     += (x, y) => SetStatus(x, new StateArg(y, false));
            mdE.SignalWriteLine += (x, y) => SetStatus(x, new StateArg(y, false));

            #endregion

            XML_Games.Signal += (x, y) => SetStatus(x, new StateArg(y, false));
        }