Merge branch 'feature/#157' into develop

This commit is contained in:
stubbfel
2013-08-15 13:53:11 +02:00
13 changed files with 324 additions and 37 deletions

View File

@@ -245,6 +245,7 @@
<Compile Include="Utility\Lui\Button\NavigateButton.cs" />
<Compile Include="Utility\Lui\Button\PhoneButton.cs" />
<Compile Include="Utility\Lui\Button\LinkButton.cs" />
<Compile Include="Utility\Lui\MessageBoxes\MessageBoxes.cs" />
<Compile Include="Utility\StringManager.cs" />
<Compile Include="Utility\Utilities.cs">
<SubType>Code</SubType>

View File

@@ -13,6 +13,7 @@ namespace CampusAppWP8.Pages.Departments
using System.Windows.Navigation;
using CampusAppWP8.Feed.Departments;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
/// <summary>
@@ -44,6 +45,8 @@ namespace CampusAppWP8.Pages.Departments
}
DepartmentIndexPage.feed.onLoaded += new DepartmentFeed.OnLoaded(this.SetupFacultyList);
DepartmentIndexPage.feed.onFailedWeb += new DepartmentFeed.OnFailed(this.FeedIsFailWeb);
DepartmentIndexPage.feed.onFailedFile += new DepartmentFeed.OnFailed(this.FeedIsFailFile);
DepartmentIndexPage.feed.LoadData();
if (DepartmentIndexPage.favorite == null)
@@ -52,6 +55,7 @@ namespace CampusAppWP8.Pages.Departments
}
DepartmentIndexPage.favorite.onLoaded += new DepartmentFavoriteFeed.OnLoaded(this.CheckFavoriteFeed);
DepartmentIndexPage.favorite.onFailedFile += new DepartmentFavoriteFeed.OnFailed(this.FeedIsFailFile);
DepartmentIndexPage.favorite.LoadData();
}
@@ -205,5 +209,22 @@ namespace CampusAppWP8.Pages.Departments
{
DepartmentIndexPage.feed.ForceWebUpdate();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailWeb()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
DepartmentIndexPage.feed.ForceReadFile();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailFile()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
}
}
}

View File

@@ -8,9 +8,11 @@
namespace CampusAppWP8.Pages.Events
{
using System;
using System.Windows;
using System.Windows.Navigation;
using CampusAppWP8.Feed.Events;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
@@ -43,6 +45,8 @@ namespace CampusAppWP8.Pages.Events
}
EventIndexPage.eventFeed.onLoaded += new EventFeed.OnLoaded(this.SetupEventPageList);
EventIndexPage.eventFeed.onFailedWeb += new EventFeed.OnFailed(this.FeedIsFailWeb);
EventIndexPage.eventFeed.onFailedFile += new EventFeed.OnFailed(this.FeedIsFailFile);
EventIndexPage.eventFeed.LoadData();
}
@@ -103,5 +107,22 @@ namespace CampusAppWP8.Pages.Events
{
EventIndexPage.eventFeed.ForceWebUpdate();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailWeb()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
EventIndexPage.eventFeed.ForceReadFile();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailFile()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
}
}
}

View File

@@ -15,6 +15,7 @@ namespace CampusAppWP8.Pages.Lecture
using CampusAppWP8.Model.Lecture;
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
/// <summary>
@@ -166,6 +167,7 @@ namespace CampusAppWP8.Pages.Lecture
{
this.api = new LectureApi();
this.api.onLoaded += new LectureApi.OnLoaded(this.ApiIsReady);
this.api.onFailed += new LectureApi.OnFailed(this.ApiIsFail);
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
List<UrlParamModel> parameterList = this.CreateUrlParameter();
this.api.SetUriParams(parameterList);
@@ -239,6 +241,15 @@ namespace CampusAppWP8.Pages.Lecture
this.To.ItemsSource = this.pageModel.ToNumberList.List;
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void ApiIsFail()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad);
this.ProgressBar.Visibility = Visibility.Collapsed;
}
#endregion
#endregion

View File

@@ -8,8 +8,11 @@
namespace CampusAppWP8.Pages.Links
{
using System;
using System.Windows;
using System.Windows.Navigation;
using CampusAppWP8.Feed.Link;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
/// <summary>
@@ -103,6 +106,8 @@ namespace CampusAppWP8.Pages.Links
{
this.commonLinkFeed = new CommonLinkFeed();
this.commonLinkFeed.onLoaded += new CommonLinkFeed.OnLoaded(this.CommonLinkFeedIsReady);
this.commonLinkFeed.onFailedWeb += new CommonLinkFeed.OnFailed(this.CommonLinkFeedIsFailWeb);
this.commonLinkFeed.onFailedFile += new CommonLinkFeed.OnFailed(this.FeedIsFailFile);
}
/// <summary>
@@ -112,6 +117,8 @@ namespace CampusAppWP8.Pages.Links
{
this.clubLinkFeed = new ClubLinkFeed();
this.clubLinkFeed.onLoaded += new ClubLinkFeed.OnLoaded(this.ClubLinkFeedIsReady);
this.clubLinkFeed.onFailedWeb += new ClubLinkFeed.OnFailed(this.ClubLinkFeedIsFailWeb);
this.clubLinkFeed.onFailedFile += new ClubLinkFeed.OnFailed(this.FeedIsFailFile);
}
/// <summary>
@@ -120,12 +127,7 @@ namespace CampusAppWP8.Pages.Links
private void CommonLinkFeedIsReady()
{
this.SetupCommonPivot();
this.loadingFeeds--;
if (this.loadingFeeds < 1)
{
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
}
this.SetupProgressBarVisibilityCollapsed();
}
/// <summary>
@@ -134,11 +136,7 @@ namespace CampusAppWP8.Pages.Links
private void ClubLinkFeedIsReady()
{
this.SetupClubPivot();
this.loadingFeeds--;
if (this.loadingFeeds < 1)
{
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
}
this.SetupProgressBarVisibilityCollapsed();
}
/// <summary>
@@ -170,6 +168,45 @@ namespace CampusAppWP8.Pages.Links
this.commonLinkFeed.ForceWebUpdate();
this.clubLinkFeed.ForceWebUpdate();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void ClubLinkFeedIsFailWeb()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
this.clubLinkFeed.ForceReadFile();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void CommonLinkFeedIsFailWeb()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
this.commonLinkFeed.ForceReadFile();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailFile()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
this.SetupProgressBarVisibilityCollapsed();
}
/// <summary>
/// Method set the visibility of the ProgressBar to Collapsed if loadingFeeds less then 1
/// </summary>
private void SetupProgressBarVisibilityCollapsed()
{
this.loadingFeeds--;
if (this.loadingFeeds < 1)
{
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
}
}
#endregion
#endregion

View File

@@ -8,9 +8,12 @@
namespace CampusAppWP8.Pages.Mensa
{
using System;
using System.Windows;
using System.Windows.Navigation;
using CampusAppWP8.Feed.GeoApi;
using CampusAppWP8.Feed.Mensa;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
/// <summary>
@@ -92,13 +95,22 @@ namespace CampusAppWP8.Pages.Mensa
#region private
/// <summary>
/// Method will be execute if the SPSAPI is ready
/// Method will be execute if the SPSAPI is ready
/// </summary>
private void SpsApiIsReady()
{
this.InitializeFeed(this.campusApi.GetCampus());
}
/// <summary>
/// Method will be execute if the SPSAPI is failed
/// </summary>
private void SpsApiIsFail()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorCampusLoc);
this.InitializeFeed(Settings.UserProfil.DefaultCampus);
}
/// <summary>
/// Method determine campus and load data from correct feed
/// </summary>
@@ -106,6 +118,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 +131,8 @@ namespace CampusAppWP8.Pages.Mensa
{
this.feed = MensaFeed.CreateCampusMensaFeed(campus);
this.feed.onLoaded += new MensaFeed.OnLoaded(this.FeedIsReady);
this.feed.onFailedWeb += new MensaFeed.OnFailed(this.FeedIsFailWeb);
this.feed.onFailedFile += new MensaFeed.OnFailed(this.FeedIsFailFile);
this.CalcSelectedIndex();
if (this.forceLoad)
@@ -162,6 +177,24 @@ namespace CampusAppWP8.Pages.Mensa
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailWeb()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
this.feed.ForceReadFile();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailFile()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
}
/// <summary>
/// Method set ItemSource and SelectedIndex for the pivot
/// </summary>

View File

@@ -8,9 +8,11 @@
namespace CampusAppWP8.Pages.News
{
using System;
using System.Windows;
using System.Windows.Navigation;
using CampusAppWP8.Feed.News;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
@@ -43,6 +45,8 @@ namespace CampusAppWP8.Pages.News
}
NewsIndexPage.newsFeed.onLoaded += new NewsFeed.OnLoaded(this.SetupNewsPageList);
NewsIndexPage.newsFeed.onFailedWeb += new NewsFeed.OnFailed(this.FeedIsFailWeb);
NewsIndexPage.newsFeed.onFailedFile += new NewsFeed.OnFailed(this.FeedIsFailFile);
NewsIndexPage.newsFeed.LoadData();
}
@@ -103,5 +107,22 @@ namespace CampusAppWP8.Pages.News
{
NewsIndexPage.newsFeed.ForceWebUpdate();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailWeb()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
NewsIndexPage.newsFeed.ForceReadFile();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailFile()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
}
}
}

View File

@@ -8,10 +8,12 @@
namespace CampusAppWP8.Pages.Openinghours
{
using System;
using System.Windows;
using System.Windows.Navigation;
using CampusAppWP8.Feed.Openinghours;
using CampusAppWP8.Model.Openinghours;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
/// <summary>
@@ -46,6 +48,8 @@ namespace CampusAppWP8.Pages.Openinghours
{
this.feed = new OpeninghoursFeed();
this.feed.onLoaded += new OpeninghoursFeed.OnLoaded(this.FeedIsReady);
this.feed.onFailedWeb += new OpeninghoursFeed.OnFailed(this.FeedIsFailWeb);
this.feed.onFailedFile += new OpeninghoursFeed.OnFailed(this.FeedIsFailFile);
this.feed.LoadData();
}
@@ -130,6 +134,23 @@ namespace CampusAppWP8.Pages.Openinghours
this.feed.ForceWebUpdate();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailWeb()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
this.feed.ForceReadFile();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailFile()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
}
// private
#endregion

View File

@@ -8,14 +8,15 @@
namespace CampusAppWP8.Pages
{
using System;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Threading;
/// <summary>
/// Class for the StartPage
@@ -155,7 +156,7 @@ namespace CampusAppWP8.Pages
/// </summary>
private void GeoWatchOptIN()
{
MessageBoxResult result = MessageBox.Show(AppResources.GeoWatch_OptInText, AppResources.GeoWatch_OptInHeader, MessageBoxButton.OKCancel);
MessageBoxResult result = MessageBoxes.ShowGoeWatchOptInBox();
if (result == MessageBoxResult.OK)
{

View File

@@ -7,10 +7,13 @@
//----------------------------------------------------------------------
namespace CampusAppWP8.Pages.StudentCouncil
{
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using CampusAppWP8.Feed.StudentCouncil;
using System;
using System.Windows;
using System.Windows.Navigation;
using CampusAppWP8.Feed.StudentCouncil;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
/// <summary>
/// Class for the StudentCouncilPage
@@ -78,6 +81,8 @@ namespace CampusAppWP8.Pages.StudentCouncil
{
this.feed = new StudentCouncilFeed();
this.feed.onLoaded += new StudentCouncilFeed.OnLoaded(this.FeedIsReady);
this.feed.onFailedWeb += new StudentCouncilFeed.OnFailed(this.FeedIsFailWeb);
this.feed.onFailedFile += new StudentCouncilFeed.OnFailed(this.FeedIsFailFile);
}
/// <summary>
@@ -109,6 +114,24 @@ namespace CampusAppWP8.Pages.StudentCouncil
this.feed.ForceWebUpdate();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailWeb()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadWeb);
this.feed.ForceReadFile();
}
/// <summary>
/// Method will be execute if the feed is failed
/// </summary>
private void FeedIsFailFile()
{
MessageBoxResult result = MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoadFile);
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
}
#endregion
#endregion

View File

@@ -240,24 +240,6 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Ortung ähnelt.
/// </summary>
public static string GeoWatch_OptInHeader {
get {
return ResourceManager.GetString("GeoWatch_OptInHeader", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Dürfen Positionsdaten enhoben und verwendet werden? ähnelt.
/// </summary>
public static string GeoWatch_OptInText {
get {
return ResourceManager.GetString("GeoWatch_OptInText", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Hinweis ähnelt.
/// </summary>
@@ -582,6 +564,69 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Der aktuelle Campus konnte nicht ermittelt werden. Es wird der im Profil festgelegten Campus verwendet. ähnelt.
/// </summary>
public static string MsgBox_ErrorCampusLoc {
get {
return ResourceManager.GetString("MsgBox_ErrorCampusLoc", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Fehler ähnelt.
/// </summary>
public static string MsgBox_ErrorHeader {
get {
return ResourceManager.GetString("MsgBox_ErrorHeader", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Beim Laden des Inhaltes ist ein Fehler aufgetreten ähnelt.
/// </summary>
public static string MsgBox_ErrorMainModelLoad {
get {
return ResourceManager.GetString("MsgBox_ErrorMainModelLoad", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Datei konnte nicht geladen werden ähnelt.
/// </summary>
public static string MsgBox_ErrorMainModelLoadFile {
get {
return ResourceManager.GetString("MsgBox_ErrorMainModelLoadFile", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Es konnte kein neuer Inhalt aus den Web geladen werden ähnelt.
/// </summary>
public static string MsgBox_ErrorMainModelLoadWeb {
get {
return ResourceManager.GetString("MsgBox_ErrorMainModelLoadWeb", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Ortung ähnelt.
/// </summary>
public static string MsgBox_GeoWatchOptInHeader {
get {
return ResourceManager.GetString("MsgBox_GeoWatchOptInHeader", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Dürfen Positionsdaten enhoben und verwendet werden? ähnelt.
/// </summary>
public static string MsgBox_GeoWatchOptInText {
get {
return ResourceManager.GetString("MsgBox_GeoWatchOptInText", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die News ähnelt.
/// </summary>

View File

@@ -359,10 +359,10 @@
<data name="MensaApp_Soup" xml:space="preserve">
<value>Suppe</value>
</data>
<data name="GeoWatch_OptInHeader" xml:space="preserve">
<data name="MsgBox_GeoWatchOptInHeader" xml:space="preserve">
<value>Ortung</value>
</data>
<data name="GeoWatch_OptInText" xml:space="preserve">
<data name="MsgBox_GeoWatchOptInText" xml:space="preserve">
<value>Dürfen Positionsdaten enhoben und verwendet werden?</value>
</data>
<data name="Campus_CBMain" xml:space="preserve">
@@ -392,4 +392,19 @@
<data name="Setting_ApplAppBarTitle" xml:space="preserve">
<value>Appeinstellungen</value>
</data>
<data name="MsgBox_ErrorCampusLoc" xml:space="preserve">
<value>Der aktuelle Campus konnte nicht ermittelt werden. Es wird der im Profil festgelegten Campus verwendet.</value>
</data>
<data name="MsgBox_ErrorHeader" xml:space="preserve">
<value>Fehler</value>
</data>
<data name="MsgBox_ErrorMainModelLoad" xml:space="preserve">
<value>Beim Laden des Inhaltes ist ein Fehler aufgetreten </value>
</data>
<data name="MsgBox_ErrorMainModelLoadFile" xml:space="preserve">
<value>Datei konnte nicht geladen werden</value>
</data>
<data name="MsgBox_ErrorMainModelLoadWeb" xml:space="preserve">
<value>Es konnte kein neuer Inhalt aus den Web geladen werden</value>
</data>
</root>

View File

@@ -0,0 +1,37 @@
//-----------------------------------------------------------------------
// <copyright file="MessageBoxes.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>15.08.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Utility.Lui.MessageBoxes
{
using System.Windows;
using CampusAppWP8.Resources;
/// <summary>
/// Class creates some MessageBoxes
/// </summary>
public class MessageBoxes
{
/// <summary>
/// Method show the MessageBox for the GeoWatch-OptIn
/// </summary>
/// <returns>result of the UserInteraction</returns>
public static MessageBoxResult ShowGoeWatchOptInBox()
{
return MessageBox.Show(AppResources.MsgBox_GeoWatchOptInText, AppResources.MsgBox_GeoWatchOptInHeader, MessageBoxButton.OKCancel);
}
/// <summary>
/// Method show the MessageBox for the ErrorMessageBox
/// </summary>
/// <param name="text">custom text for the box</param>
/// <returns>result of the UserInteraction</returns>
public static MessageBoxResult ShowMainModelErrorMessageBox(string text)
{
return MessageBox.Show(text, AppResources.MsgBox_ErrorHeader, MessageBoxButton.OK);
}
}
}