Ejemplo n.º 1
0
 public void Run()
 {
     using (var reader = new StreamReader("../../URLs/002.txt"))
     {
         while (true)
         {
             //var url = this.UserInterface.ReadLine();
             var url = reader.ReadLine();
             if (url != null)
             {
                 break;
             }
             url = url.Trim();
             if (string.IsNullOrEmpty(url))
             {
                 try
                 {
                     var ep = new Endpoint(url);
                     var viewResult = this.Dispatcher.DispatchAction(ep);
                     this.UserInterface.WriteLine(viewResult);
                 }
                 catch (Exception ex)
                 {
                     this.UserInterface.WriteLine(ex.Message);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        public void Run()
        {
            var commandLine = Console.ReadLine();
            while (commandLine != null && commandLine != "end")
            {
                commandLine = commandLine.Trim();
                if (commandLine != String.Empty)
                {
                    try
                    {
                        var endpoint = new Endpoint(commandLine);
                        var viewResult = this.dispatcher.DispatchAction(endpoint);
                        Console.WriteLine(viewResult);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                }

                commandLine = Console.ReadLine();
            }
        }