Ejemplo n.º 1
0
        /// <summary> Show main menu. </summary>
        private static void ShowMainMenu()
        {
            while (true)
            {
                if (VersionHandler.TryGetCurrentDatabaseVersion(out double version))
                {
                    ConsoleUtility.Write(Environment.UserName, ConsoleColor.Yellow);
                    ConsoleUtility.WriteLine("->v" + version, ConsoleColor.Blue);
                    ConsoleUtility.Write("-> ", TextColor);
                    string command = ConsoleUtility.ReadLine(TextColor);

                    string[] args = command.Split(' ');
                    if (CommandRegistry.ContainCommand(args[0]))
                    {
                        CommandRegistry.ExecuteCommand(args[0], args);
                    }
                    else
                    {
                        ConsoleUtility.WriteLine("Unknown command.", ErrorColor);
                    }

                    Console.WriteLine();
                }
                else
                {
                    ConsoleUtility.WriteLine("Failed to get current database version.", ErrorColor);
                    Console.ReadKey();
                    return;
                }
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            InitiateCommands();

            var argList = args.ToList();

            argList.RemoveAt(0);
            cmdController.ExecuteCommand(args[0], argList.ToList());
            Console.ReadLine();
        }