public BusStopViewController(StopInfo stopInfo) { _stopInfo = stopInfo; _busStopRepository.AddMostRecent(_stopInfo); this.Title = _stopInfo.StopName; }
public void AddFavorite(StopInfo stopInfo) { _favorites.Add(stopInfo); }
public void AddMostRecent(StopInfo stopInfo) { _mostRecent.Add(stopInfo); }
private void ReadStopInfo() { Stops = new List<StopInfo>(); Debug.WriteLine("Exists? " + File.Exists(Path.Combine(Environment.CurrentDirectory, "Data/R1615.HPL"))); try { using (var fileStream = File.Open(Path.Combine(Environment.CurrentDirectory, "Data/R1615.HPL"), FileMode.Open, FileAccess.Read)) using (var reader = new StreamReader(fileStream)) { while (!reader.EndOfStream) { var line = reader.ReadLine(); var stopInfo = new StopInfo(line); Stops.Add(stopInfo); } } } catch(Exception ex) { Debug.WriteLine(ex.ToString()); throw; } Stops = Stops.OrderBy(si => si.StopName).ToList(); }