Example #1
0
        private void ShowDepartures(Station[] allStations, Station fromStation, string from, string to, bool actSilently)
        {
            var toStationCandidates = allStations.Where(x => MainAndFilterPage.Filter(to, fromStation, null, x)).ToArray();
            var toStation           = toStationCandidates.Length == 1 ? toStationCandidates[0] : null;

            if (fromStation != null)
            {
                if (toStation != null)
                {
                    var target = DeparturesAndArrivalsTable.Create(fromStation, toStation);
                    NavigationService.Navigate(StationPage.GetUri(this, target, removeBackEntry: true));
                    return;
                }
                else
                {
                    if (string.IsNullOrEmpty(to))
                    {
                        var target = DeparturesAndArrivalsTable.Create(fromStation);
                        NavigationService.Navigate(StationPage.GetUri(this, target));
                    }
                    else
                    {
                        NavigationService.Navigate(MainAndFilterPage.GetUri(this, fromStation, initialFilter: to, removeBackEntry: true));
                    }
                    return;
                }
            }
            else
            {
                NavigationService.Navigate(MainAndFilterPage.GetUri(this, null, initialFilter: from, removeBackEntry: true));
            }
        }
Example #2
0
        private void ShowDepartures(string from, string to, bool actSilently)
        {
            var allStations           = Stations.GetAll();
            var fromStationCandidates = allStations.Where(x => MainAndFilterPage.Filter(from, null, null, x)).ToArray();
            var fromStation           = fromStationCandidates.Length == 1 ? fromStationCandidates[0] : null;

            ShowDepartures(allStations, fromStation, from, to, actSilently);
        }
Example #3
0
 private void OnFilterOrClearFilterClick(object sender, EventArgs e)
 {
     ErrorReporting.Log("OnFilterOrClearFilterClick");
     if (departuresAndArrivalsTable.HasDestinationFilter)
     {
         NavigationService.Navigate(GetUri(departuresAndArrivalsTable.WithoutFilter));
     }
     else
     {
         NavigationService.Navigate(MainAndFilterPage.GetUri(this, departuresAndArrivalsTable.Station));
     }
 }
Example #4
0
 private void OnError()
 {
     NavigationService.Navigate(MainAndFilterPage.GetUri(this, removeBackEntry: true));
 }
Example #5
0
 private void OnHomeClick(object sender, EventArgs e)
 {
     ErrorReporting.Log("OnHomeClick");
     NavigationService.Navigate(MainAndFilterPage.GetUri(this));
 }
Example #6
0
 private void OnFilterByAnotherDestinationClick(object sender, EventArgs e)
 {
     ErrorReporting.Log("OnFilterByAnotherDestinationClick");
     NavigationService.Navigate(MainAndFilterPage.GetUri(this, departuresAndArrivalsTable.Station, departuresAndArrivalsTable.CallingAt.Value));
 }