public async Task DeleteStop(RouteStop stop) { int ord = stop.Ordinal; int index = Stops.IndexOf(stop); if (index < 0) { Debug.Print($"### Route.DeleteStop(): Stop #{ord} not found in the Route"); } await AppStorage.Instance.DeleteRouteStop(stop); Stops.RemoveAt(index); if (Stops.Count == 0) { IsStarted = false; return; } if (index < Stops.Count && (stop.Status == RoutеStopStatus.Enroute || stop.Status == RoutеStopStatus.Arrived)) { var next = Stops[index]; await ChangeStopStatus(next, RoutеStopStatus.Enroute); } if (ord > 0 && stop.Status == RoutеStopStatus.Pending) { while (index < Stops.Count) { stop = Stops[index++]; stop.Ordinal = ord++; await AppStorage.Instance.ChangeRouteStopOrdinal(stop); } } await UpdateDurations(); }
public void RemoveStopAt(int index) { _source.Stops.RemoveAt(index); Stops.RemoveAt(index); }
public void RemoveAt(int index) { Stops.RemoveAt(index); }