public string RegisterHarvester(List <string> arguments) { try { var newHarvester = HarvesterFactory.Create(arguments); this.harvesters.Add(newHarvester.Id, newHarvester); return($"Successfully registered {arguments[0]} Harvester - {arguments[1]}"); } catch (ArgumentException ae) { return($"Harvester is not registered, because of it's {ae.Message}"); } }
public string RegisterHarvester(List <string> arguments) { try { Harvester h = HarvesterFactory.Create(arguments); harvesters.Add(h); return($"Successfully registered {arguments[0]} Harvester - {h.Id}"); } catch (ArgumentException ae) { return(ae.Message); } }
public string RegisterHarvester(List <string> arguments) { try { Harvester harvester = HarvesterFactory.Create(arguments.ToArray()); idsHarvesters[arguments[1]] = harvester; return($"Successfully registered {arguments[0]} Harvester - {arguments[1]}"); } catch (ArgumentException ae) { return(ae.Message); } }
public string RegisterHarvester(List <string> arguments) { try { var harvester = harvesterFactory.Create(arguments); this.harvesters.Add(harvester); this.byId.Add(arguments[1], harvester); return($"Successfully registered {arguments[0]} Harvester - {arguments[1]}"); } catch (Exception e) { return(e.Message); } }
public string RegisterHarvester(List <string> arguments) { var type = arguments[0]; var id = arguments[1]; try { harvesters.Add(id, harvesterFactory.Create(arguments)); return($"Successfully registered {type} Harvester - {id}"); } catch (Exception ex) { return(ex.Message); } }
public string RegisterHarvester(List <string> arguments) { string type = arguments[0]; string id = arguments[1]; try { harvesters.Add(id, HarvesterFactory.Create(arguments)); } catch (ArgumentException e) { return($"Harvester is not registered, because of it's {e.Message}"); } return($"Successfully registered {type} Harvester - {id}"); }
public string RegisterHarvester(List <string> arguments) { try { this.harvesters.Add(harvesterFactory.Create(arguments)); } catch (ArgumentException e) { return(e.Message); } var type = arguments[0]; var id = arguments[1]; return($"Successfully registered {type} Harvester - {id}"); }
public string RegisterHarvester(List <string> arguments) { string type = arguments[0]; try { Harvester harvester = HarvesterFactory.Create(arguments); harvesters.Add(harvester); return($"Successfully registered {type} Harvester - {harvester.Id}"); } catch (ArgumentOutOfRangeException aoore) { string propertyName = aoore.ParamName; return($"Harvester is not registered, because of it's {propertyName}"); } }
public string RegisterHarvester(List <string> arguments) { var msg = string.Empty; try { var type = arguments[0]; var id = arguments[1]; var harvester = harvesterFactory.Create(arguments); msg = $"Successfully registered {type} Harvester - {id}"; harvesters[id] = harvester; } catch (ArgumentException ae) { msg = ae.Message; } return(msg); }