add onFailed to mensaplan
This commit is contained in:
@@ -12,6 +12,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
using CampusAppWP8.Feed.GeoApi;
|
||||
using CampusAppWP8.Feed.Mensa;
|
||||
using Microsoft.Phone.Controls;
|
||||
using System.Windows;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the MensaPage
|
||||
@@ -99,6 +100,15 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
this.InitializeFeed(this.campusApi.GetCampus());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the SPSAPI is failed
|
||||
/// </summary>
|
||||
private void SpsApiIsFail()
|
||||
{
|
||||
MessageBoxResult result = MessageBox.Show("LoadModel Failed", "Fehler", MessageBoxButton.OK);
|
||||
this.InitializeFeed(Settings.UserProfil.DefaultCampus);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method determine campus and load data from correct feed
|
||||
/// </summary>
|
||||
@@ -106,6 +116,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
{
|
||||
this.campusApi = new CampusSpsApi();
|
||||
this.campusApi.onLoaded += new SpsApi.OnLoaded(this.SpsApiIsReady);
|
||||
this.campusApi.onFailed += new SpsApi.OnFailed(this.SpsApiIsFail);
|
||||
this.campusApi.SetupCurrentCampusRequest();
|
||||
this.campusApi.LoadData();
|
||||
}
|
||||
@@ -118,6 +129,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
{
|
||||
this.feed = MensaFeed.CreateCampusMensaFeed(campus);
|
||||
this.feed.onLoaded += new MensaFeed.OnLoaded(this.FeedIsReady);
|
||||
this.feed.onFailed += new MensaFeed.OnFailed(this.FeedIsFail);
|
||||
this.CalcSelectedIndex();
|
||||
|
||||
if (this.forceLoad)
|
||||
@@ -162,6 +174,14 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the feed is failed
|
||||
/// </summary>
|
||||
private void FeedIsFail()
|
||||
{
|
||||
MessageBoxResult result = MessageBox.Show("LoadModel Failed", "Fehler", MessageBoxButton.OK);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method set ItemSource and SelectedIndex for the pivot
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user