public void Run() { while (true) { string url = this.userInterface.ReadLine(); if (url == null) { break; } url = url.Trim(); if (!string.IsNullOrEmpty(url)) { try { var endpoint = new Endpoint(url); string viewResult = this.dispatcher.DispatchAction(endpoint); this.userInterface.WriteLine(viewResult); } catch (Exception ex) { this.userInterface.WriteLine(ex.Message); } } } }
public void Run() { //var result = new StringBuilder(); while (true) { string urlLine = this.userInterface.ReadLine(); //if (urlLine == "zz") //{ // break; //} if (urlLine == null) { break; } urlLine = urlLine.Trim(); if (string.IsNullOrEmpty(urlLine)) { continue; } try { var endpoint = new Endpoint(urlLine); string viewResult = this.commandExecutor.DispatchAction(endpoint); this.userInterface.WriteLine(viewResult); // result.AppendLine(viewResult); } catch (Exception ex) { this.userInterface.WriteLine(ex.Message); //result.AppendLine(ex.Message); } } //this.userInterface.WriteLine(result); }
public void Run() { string url; while ((url = Console.ReadLine()) != null) { url = url.Trim(); if (string.IsNullOrEmpty(url)) { continue; } try { var endPoint = new Endpoint(url); var viewResult = this.dispathcer.DispatchAction(endPoint); Console.WriteLine(viewResult); } catch (Exception ex) { Console.WriteLine(ex.Message); } } }