예제 #1
0
        static async Task Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;
            Console.WriteLine(Header);
            try
            {
                var settings      = Settings.LoadOrSaveSettings();
                var preProcessing = new PreProcessing(settings);
                await preProcessing.Run();

                InteractiveConsole.GenerateMenu(preProcessing);
            }
            catch (Exception ex)
            {
                LogError(ex.Message);
                LogInfo("Press Any Key to Quit..");
                Console.ReadKey();
            }
        }
        public static void GenerateMenu(PreProcessing preProcessing)
        {
            PreProcessing = preProcessing;

            Menu = new ConsoleMenu
                   (
                Program.Header,
                new[]
            {
                new ConsoleMenu.Item("Patch ChuniApp.exe", DisplayPatchesMenu, 1),
                new ConsoleMenu.Item("XML Unlocker", UnlockerMenu.DisplayUnlockerMenu, 2),
                new ConsoleMenu.Item("Option Folders Details", DisplayOptionFolderDetailsMenu, 2),
                new ConsoleMenu.Item("Run Validators", DisplayValidators, 1),
                new ConsoleMenu.Item("Export FileList", ExportFileList)
                {
                    IsToggle = true
                },
                new ConsoleMenu.Item("Compare FileList", CompareFileList)
                {
                    IsToggle = true
                },
                new ConsoleMenu.Item("Local IP", GetLocalIPAddress)
                {
                    IsToggle = true
                },
                new ConsoleMenu.Item("Exit", MenuExit),
            }
                   );

            Menu.Main.MaxColumns = 1;
            Menu.WriteLine("Use ←↑↓→ for navigation.");
            Menu.WriteLine("Press Esc for main menu.");
            Menu.WriteLine("Press Backspace for parent menu.");
            Menu.WriteLine("Press Del for clear log.");

            Menu.Begin();
        }