Merge branch 'feature/#108' into develop

This commit is contained in:
stubbfel
2013-07-16 11:42:00 +02:00
8 changed files with 49 additions and 28 deletions

View File

@@ -11,11 +11,14 @@ namespace CampusAppWP8.Api.Mensa
using System.Collections.ObjectModel;
using CampusAppWP8.Model.Mensa;
using CampusAppWP8.Utility;
using CampusAppWP8.Model;
using CampusAppWP8.Resources;
using System.IO;
/// <summary>
/// This Class is for MensaFeeds
/// </summary>
public class MensaFeed : XmlFeed<MenuWeekModel>
public class MensaFeed : XmlModel<MenuWeekModel>
{
#region Constructor
@@ -23,8 +26,10 @@ namespace CampusAppWP8.Api.Mensa
/// Initializes a new instance of the <see cref="MensaFeed" /> class.
/// </summary>
public MensaFeed()
: base(URLList.MensaFeedURL, FileList.MensaXmlFile)
: base(ModelType.FileAndFeed, Constants.FileMensa_Shedule, Constants.UrlMensa_Week)
{
this.isFileUpToDate += new IsFileUpToDate(this.CheckIsFileUpToDate);
this.isModelUpToDate += new IsModelUpToDate(this.CheckIsModelUpToDate);
}
#endregion
@@ -37,9 +42,13 @@ namespace CampusAppWP8.Api.Mensa
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>
/// </summary>
/// <returns>true, if model is up-to-date, otherwise false</returns>
protected override bool CheckIsModelUpToDate()
private bool CheckIsModelUpToDate(MenuWeekModel model)
{
DateTime lastModified = this.Model.CreateTime;
if (model == null)
{
return false;
}
DateTime lastModified = model.CreateTime;
return this.CheckIsUpToDate(lastModified);
}
@@ -47,9 +56,9 @@ namespace CampusAppWP8.Api.Mensa
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>
/// </summary>
/// <returns>true, if file is up-to-date, otherwise false</returns>
protected override bool CheckIsFileUpToDate()
private bool CheckIsFileUpToDate(MenuWeekModel model, FileInfo fileInfo)
{
DateTime lastModified = FileManager.GetFileInfo(FileName).LastWriteTime;
DateTime lastModified = fileInfo.LastWriteTime;
return this.CheckIsUpToDate(lastModified);
}

View File

@@ -96,6 +96,15 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die MensaFeed.xml ähnelt.
/// </summary>
public static string FileMensa_Shedule {
get {
return ResourceManager.GetString("FileMensa_Shedule", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die StudentCouncils.xml ähnelt.
/// </summary>
@@ -106,7 +115,7 @@ namespace CampusAppWP8.Resources {
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die ähnelt.
/// Sucht eine lokalisierte Zeichenfolge, die IsolatedStorage_DepartmentFavoriteModel ähnelt.
/// </summary>
public static string IsolatedStorage_DepartmentFavoriteModel {
get {
@@ -141,15 +150,6 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die ähnelt.
/// </summary>
public static string LinkApp_CommonLinks {
get {
return ResourceManager.GetString("LinkApp_CommonLinks", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Studiengang ähnelt.
/// </summary>
@@ -438,6 +438,15 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/ ähnelt.
/// </summary>
public static string UrlMensa_Week {
get {
return ResourceManager.GetString("UrlMensa_Week", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=studentcouncils&amp;app=2&amp;appversion=1 ähnelt.
/// </summary>

View File

@@ -190,7 +190,7 @@
<value>/Pages/Openinghours/OpeninghoursPage.xaml</value>
</data>
<data name="IsolatedStorage_DepartmentFavoriteModel" xml:space="preserve">
<value />
<value>IsolatedStorage_DepartmentFavoriteModel</value>
</data>
<data name="FileDepartment_Favorite_Name" xml:space="preserve">
<value>DepartmentFavoriteFeed.xml</value>
@@ -249,7 +249,10 @@
<data name="UrlStudentCouncil_StudentCouncils" xml:space="preserve">
<value>http://www.tu-cottbus.de/campusapp-data/getdata.php?db=studentcouncils&amp;app=2&amp;appversion=1</value>
</data>
<data name="LinkApp_CommonLinks" xml:space="preserve">
<value />
<data name="FileMensa_Shedule" xml:space="preserve">
<value>MensaFeed.xml</value>
</data>
<data name="UrlMensa_Week" xml:space="preserve">
<value>http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/</value>
</data>
</root>

View File

@@ -24,12 +24,12 @@ namespace CampusAppWP8.Utility.Lui.Button
public static readonly DependencyProperty NavigateProperty = DependencyProperty.Register("Url", typeof(object), typeof(NavigateButton), new PropertyMetadata(false));
/// <summary>
/// Register the QuerryValueProperty
/// Register the QueryValueProperty
/// </summary>
public static readonly DependencyProperty QueryValueProperty = DependencyProperty.Register("QuerryStringValue", typeof(object), typeof(NavigateButton), new PropertyMetadata(false));
/// <summary>
/// Register the QuerryNameProperty
/// Register the QueryNameProperty
/// </summary>
public static readonly DependencyProperty QueryNameProperty = DependencyProperty.Register("QuerryStringName", typeof(object), typeof(NavigateButton), new PropertyMetadata(false));
@@ -59,7 +59,7 @@ namespace CampusAppWP8.Utility.Lui.Button
}
/// <summary>
/// Gets or sets the QuerryStringName
/// Gets or sets the QueryStringName
/// </summary>
public object QuerryStringName
{
@@ -68,7 +68,7 @@ namespace CampusAppWP8.Utility.Lui.Button
}
/// <summary>
/// Gets or sets the QuerryStringValue
/// Gets or sets the QueryStringValue
/// </summary>
public object QuerryStringValue
{

View File

@@ -67,7 +67,7 @@ namespace CampusAppWP8
this.fileName = fileName;
if ((this.IsFile() == true)
&& (fileName.Equals(string.Empty) == false))
&& (fileName.Equals(string.Empty) == false))
{
this.InitFile(CampusAppWP8.Utility.File.IOTypeRead.ReadSync, CampusAppWP8.Utility.File.IOTypeWrite.WriteAsync);
}

View File

@@ -88,7 +88,7 @@
</lui:NavigateButton>
<!-- Row 2 -->
<lui:NavigateButton Name="DepartmentAppButton" Grid.Row="2" Grid.Column="0" Style="{StaticResource StartPageButton}" IsEnabled="False">
<lui:NavigateButton Name="DepartmentAppButton" Grid.Row="2" Grid.Column="0" Style="{StaticResource StartPageButton}" Url="{Binding Path=Constants.PathDepartment_DepartmentIndexPage, Source={StaticResource Const}}">
<StackPanel Style="{StaticResource StartPageStackPanelStyle}">
<Image Source="{Binding Path=ThemelizedIcon.Departments, Source={StaticResource ThemelizedIcons}}" Style="{StaticResource StartPageButtonImg}"/>
<TextBlock Text="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" Style="{StaticResource StartPageButtonText}"/>

View File

@@ -66,7 +66,7 @@ namespace CampusAppWP8.Pages.Mensa
this.InitializeFeed();
}
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
this.feed.LoadFeed();
this.feed.LoadData();
}
#endregion
#region private
@@ -77,7 +77,7 @@ namespace CampusAppWP8.Pages.Mensa
private void InitializeFeed()
{
this.feed = new MensaFeed();
this.feed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.FeedIsReady);
this.feed.onLoaded += new MensaFeed.OnLoaded(this.FeedIsReady);
this.CalcSelectedIndex();
}

View File

@@ -18,7 +18,7 @@ namespace CampusAppWP8.Utility
/// <summary>
/// Name of the file for the feed of the mensa.
/// </summary>
public static readonly string MensaXmlFile = "MesaFeed.xml";
public static readonly string MensaXmlFile = "MensaFeed.xml";
/// <summary>
/// Opening hours feed file name.