Exemple #1
0
        private void updateLine(TransitLine updateLine, System.Collections.IList newArrivals)
        {
            var lineToUpdate = Lines.Single(line => line.Equals(updateLine));

            foreach (var newArrival in newArrivals)
            {
                var arrival = DateTime.Parse(newArrival.ToString());
                lineToUpdate.Arrivals.Add(new ArrivalViewModel()
                {
                    ArrivalTime      = arrival.ToString("h:mm"),
                    WhenINeedToLeave = (arrival - DateTime.Now - updateLine.WalkTime + TimeSpan.FromSeconds(1)).Minutes.ToString() + " min",
                }
                                          );
            }
        }
Exemple #2
0
 private void Arrivals_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e, TransitLine line)
 {
     updateLine(line, e.NewItems);
 }