コード例 #1
0
        public void OnSelected()
        {
            Directory.SetCurrentDirectory(Global.LaunchBoxPath);

            Global.InitializeConfig();

            //return;
            try
            {
                /*TextWriterTraceListener textWriter = new TextWriterTraceListener(@".././Logs/SappPasRoot.log");
                 * //Ajout bit à bit de deux options de sortie
                 * textWriter.TraceOutputOptions = TraceOptions.Callstack | TraceOptions.ProcessId | TraceOptions.Timestamp;
                 *
                 * Trace.Listeners.Add(textWriter);
                 * Trace.AutoFlush = true;
                 * Trace.WriteLine($"\n {new string('=', 10)} Initialization {new string('=', 10)}");*/

                MeSimpleLog meSL = new MeSimpleLog(Path.Combine(Global.LaunchBoxRoot, Sett.Default.LogFolder, Sett.Default.LogFile))
                {
                    //Prefix
                    LogLevel   = Global.Config.LogLvl,
                    ByPass     = true,
                    FuncPrefix = EPrefix.Prefixing | EPrefix.Horodating
                };

                HeTrace.AddLogger("Logger", meSL);
                HeTrace.WriteLine("Init ok", callerName: "Logger");
                HeTrace.WriteLine($"LaunchBox Path: {Global.LaunchBoxPath}");
                HeTrace.WriteLine($"LaunchBox Root (found): {Global.LaunchBoxRoot}");

                //PluginHelper. .LaunchBoxMainForm.FormClosing += new FormClosingEventHandler(Fermeture);

                // 2020/30/10 verif
                W_PlateformsList sp = new W_PlateformsList();
                sp.ShowDialog();
                // 2020/30/10 verif
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
                // Trace.WriteLine(e);
                using (StreamWriter file = new StreamWriter(@".././Logs/#err.txt"))
                {
                    file.WriteLine(e);
                }
            }
            HeTrace.RemoveLogger("Logger");
        }
コード例 #2
0
        public static void Main()
        {
            Global.DebugMode = true;

            Global.SetPluginLocation();

            Global.InitializeConfig();

            // Initialisation du messager
            MeDebug meD = new MeDebug()
            {
                //Prefix = "",
                LogLevel = 10,
                ByPass   = true,
            };
            //meD.AddCaller(prefix: "Debug >>>");

            MeSimpleLog meSL = new MeSimpleLog(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, prop.Default.LogFolder, prop.Default.LogFile))
            {
                LogLevel   = Global.Config.LogLvl,
                ByPass     = true,
                FuncPrefix = Hermes.Cont.EPrefix.Horodating | Hermes.Cont.EPrefix.Prefixing
            };

            meSL.AddCaller(prefix: "DeDebug >>>");

            HeTrace.AddMessenger("Debug", meD);
            HeTrace.AddLogger("Logger", meSL);

            Hermes.HeTrace.WriteLine("Test");

            // On indique manuellement en debug
            Global.LaunchBoxPath = @"G:\Frontend\LaunchBox\Core\";

            string[] tmp = Global.LaunchBoxPath.Split(@"\");

            Global.SetLaunchBoxRoot();


            // Création de fausses plateformes
            MvPlatform plat1 = new MvPlatform()
            {
                Name = "Don't exists/proche reel", Folder = @"G:\Ailleurs\Games\Sega Genesis"
            };
            MvPlatform plat2 = new MvPlatform()
            {
                Name = "Nintendo Entertainment System", Folder = @"i:\Games\NES"
            };
            MvPlatform plat3 = new MvPlatform()
            {
                Name = "Sega Master System", Folder = @""
            };
            MvPlatform plat4 = new MvPlatform()
            {
                Name = "Sega Master System", Folder = @"../../Plateformes/Games/Sega Master System"
            };
            MvPlatform plat5 = new MvPlatform()
            {
                Name = "different letter/proche reel", Folder = @"m:\Ailleurs\Games\Sega Genesis"
            };
            MvPlatform plat6 = new MvPlatform()
            {
                Name = "Racine de Disque", Folder = @"..\..\Games\Sega Genesis"
            };
            MvPlatform plat7 = new MvPlatform()
            {
                Name = "Normal", Folder = @"..\..\Plateformes\Games\Sega Mega Drive"
            };
            MvPlatform plat8 = new MvPlatform()
            {
                Name = "Metzo", Folder = @"..\Plateformes\Games\Sega Genesis"
            };
            MvPlatform plat9 = new MvPlatform()
            {
                Name = "racine", Folder = @"..\..\Games\Sega Mega Drive"
            };


            FakePlatforms = new ObservableCollection <IPlatform>();
            FakePlatforms.Add(plat1);
            FakePlatforms.Add(plat2);
            FakePlatforms.Add(plat3);
            FakePlatforms.Add(plat4);
            FakePlatforms.Add(plat5);
            FakePlatforms.Add(plat6);
            FakePlatforms.Add(plat7);
            FakePlatforms.Add(plat8);
            FakePlatforms.Add(plat9);

            //
            W_PlateformsList wpl = new W_PlateformsList();

            wpl.ShowDialog();
        }