示例#1
0
        public static void Main()
        {
            ServiceProvider        _serviceProvider = ConfigureServiceProvider();
            FileCommandParser      commandParser    = _serviceProvider.GetRequiredService <FileCommandParser>();
            AuthorizeCommandParser authorizeParser  = _serviceProvider.GetRequiredService <AuthorizeCommandParser>();

            Console.WriteLine("Runned");
            Authorize(authorizeParser);
            while (true)
            {
                ReadUserCommand(commandParser);
            }
        }
示例#2
0
 private static void Authorize(AuthorizeCommandParser authorizeParser)
 {
     Console.WriteLine("Authorize to use the program.");
     {
         try
         {
             HandleInput(authorizeParser);
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex.Message);
             Authorize(authorizeParser);
         }
     }
 }