Merge branch 'release/r#112' into develmaster
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>13.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Api.Lecture
|
||||
namespace CampusAppWP8.Feed.Lecture
|
||||
{
|
||||
using System;
|
||||
using CampusAppWP8.Model.Lecture;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>24.06.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Api.Events
|
||||
namespace CampusAppWP8.Feed.Events
|
||||
{
|
||||
using CampusAppWP8.Model.RSS;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// <author>stubbfel</author>
|
||||
// <sience>03.05.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Api.Mensa
|
||||
namespace CampusAppWP8.Feed.Mensa
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// <author>fiedlchr</author>
|
||||
// <sience>24.06.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Api.News
|
||||
namespace CampusAppWP8.Feed.News
|
||||
{
|
||||
using CampusAppWP8.Model.RSS;
|
||||
using CampusAppWP8.Utility;
|
||||
|
||||
@@ -8,14 +8,15 @@
|
||||
namespace CampusAppWP8.Feed.Openinghours
|
||||
{
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using CampusAppWP8.Model;
|
||||
using CampusAppWP8.Model.Openinghours;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// This Class is for MesaFeeds
|
||||
/// </summary>
|
||||
public class OpeninghoursFeed : XmlFeed<OpeninghoursModel>
|
||||
public class OpeninghoursFeed : XmlModel<OpeninghoursModel>
|
||||
{
|
||||
#region Constructor
|
||||
|
||||
@@ -23,40 +24,46 @@ namespace CampusAppWP8.Feed.Openinghours
|
||||
/// Initializes a new instance of the <see cref="OpeninghoursFeed" /> class.
|
||||
/// </summary>
|
||||
public OpeninghoursFeed()
|
||||
: base(URLList.OpeninghoursFeedURL, FileList.OpeninghoursXmlFile)
|
||||
: base(ModelType.FileAndFeed, Constants.FileOpeningHours_OpeningHours, Constants.UrlOpeningHours_OpeningHours)
|
||||
{
|
||||
this.isFileUpToDate += new IsFileUpToDate(this.CheckIsFileUpToDate);
|
||||
this.isModelUpToDate += new IsModelUpToDate(this.CheckIsModelUpToDate);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region Protected
|
||||
|
||||
/// <summary>
|
||||
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>.
|
||||
/// </summary>
|
||||
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||
protected override bool CheckIsModelUpToDate()
|
||||
{
|
||||
DateTime lastModified = this.Model.CreateTime;
|
||||
return this.CheckIsUpToDate(lastModified);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
|
||||
/// </summary>
|
||||
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||
protected override bool CheckIsFileUpToDate()
|
||||
{
|
||||
DateTime lastModified = FileManager.GetFileInfo(FileName).LastWriteTime;
|
||||
return this.CheckIsUpToDate(lastModified);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private
|
||||
|
||||
/// <summary>
|
||||
/// Method check if the FeedModel is up-to-date
|
||||
/// </summary>
|
||||
/// <param name="model">reference of the FeedModel</param>
|
||||
/// <returns>true, if model is up-to-date, otherwise false</returns>
|
||||
private bool CheckIsModelUpToDate(OpeninghoursModel model)
|
||||
{
|
||||
if (model == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
DateTime lastModified = model.CreateTime;
|
||||
return this.CheckIsUpToDate(lastModified);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method check if the FeedFile is up-to-date
|
||||
/// </summary>
|
||||
/// <param name="model">reference of the FeedModel</param>
|
||||
/// <param name="fileInfo">info about the file</param>
|
||||
/// <returns>true, if file is up-to-date, otherwise false</returns>
|
||||
private bool CheckIsFileUpToDate(OpeninghoursModel model, FileInfo fileInfo)
|
||||
{
|
||||
DateTime lastModified = fileInfo.LastWriteTime;
|
||||
return this.CheckIsUpToDate(lastModified);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the model or file is up-to-date.
|
||||
/// </summary>
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace CampusAppWP8.Feed.StudentCouncil
|
||||
return false;
|
||||
}
|
||||
|
||||
DateTime lastModified = this.Model.CreateTime;
|
||||
DateTime lastModified = model.CreateTime;
|
||||
return this.CheckIsUpToDate(lastModified);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CampusAppWP8.Pages.Events
|
||||
{
|
||||
using System.Linq;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Api.Events;
|
||||
using CampusAppWP8.Feed.Events;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CampusAppWP8.Pages.Lecture
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Api.Lecture;
|
||||
using CampusAppWP8.Feed.Lecture;
|
||||
using CampusAppWP8.Model.Lecture;
|
||||
using CampusAppWP8.Model.Utility;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
@@ -7,13 +7,9 @@
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Pages.Links
|
||||
{
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Feed.Link;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the LinkPage
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CampusAppWP8.Pages.News
|
||||
{
|
||||
using System.Linq;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Api.News;
|
||||
using CampusAppWP8.Feed.News;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
|
||||
@@ -7,15 +7,10 @@
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Pages.Openinghours
|
||||
{
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Feed.Openinghours;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Tasks;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Opening hours page.
|
||||
/// </summary>
|
||||
@@ -64,7 +59,7 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
}
|
||||
|
||||
this.feed.LoadFeed();
|
||||
this.feed.LoadData();
|
||||
}
|
||||
|
||||
// protected
|
||||
@@ -78,7 +73,7 @@ namespace CampusAppWP8.Pages.Openinghours
|
||||
private void InitializeFeed()
|
||||
{
|
||||
this.feed = new OpeninghoursFeed();
|
||||
this.feed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.FeedIsReady);
|
||||
this.feed.onLoaded += new OpeninghoursFeed.OnLoaded(this.FeedIsReady);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -7,15 +7,9 @@
|
||||
//----------------------------------------------------------------------
|
||||
namespace CampusAppWP8.Pages.StudentCouncil
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Feed.StudentCouncil;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Tasks;
|
||||
using CampusAppWP8.Feed.StudentCouncil;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the StudentCouncilPage
|
||||
|
||||
@@ -105,6 +105,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die OpeninghoursFeed.xml ähnelt.
|
||||
/// </summary>
|
||||
public static string FileOpeningHours_OpeningHours {
|
||||
get {
|
||||
return ResourceManager.GetString("FileOpeningHours_OpeningHours", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die StudentCouncils.xml ähnelt.
|
||||
/// </summary>
|
||||
@@ -447,6 +456,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=openinghours&app=2&appversion=1 ähnelt.
|
||||
/// </summary>
|
||||
public static string UrlOpeningHours_OpeningHours {
|
||||
get {
|
||||
return ResourceManager.GetString("UrlOpeningHours_OpeningHours", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=studentcouncils&app=2&appversion=1 ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -255,4 +255,10 @@
|
||||
<data name="UrlMensa_Week" xml:space="preserve">
|
||||
<value>http://www.studentenwerk-frankfurt.de/2011/ClassPackage/App_IKMZ_BTU/</value>
|
||||
</data>
|
||||
<data name="FileOpeningHours_OpeningHours" xml:space="preserve">
|
||||
<value>OpeninghoursFeed.xml</value>
|
||||
</data>
|
||||
<data name="UrlOpeningHours_OpeningHours" xml:space="preserve">
|
||||
<value>http://www.tu-cottbus.de/campusapp-data/getdata.php?db=openinghours&app=2&appversion=1</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -9,9 +9,8 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Api.Mensa;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Phone.Controls;
|
||||
using CampusAppWP8.Feed.Mensa;
|
||||
using Microsoft.Phone.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the MensaPage
|
||||
@@ -68,7 +67,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
|
||||
this.feed.LoadData();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
@@ -77,10 +76,10 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
private void InitializeFeed()
|
||||
{
|
||||
this.feed = new MensaFeed();
|
||||
this.feed.onLoaded += new MensaFeed.OnLoaded(this.FeedIsReady);
|
||||
this.feed.onLoaded += new MensaFeed.OnLoaded(this.FeedIsReady);
|
||||
this.CalcSelectedIndex();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the feed is ready
|
||||
@@ -98,7 +97,7 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
{
|
||||
this.MensaPivot.ItemsSource = this.feed.Model.Menus;
|
||||
this.MensaPivot.SelectedIndex = this.selectedIndex;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method calculate which pivot has to be selected
|
||||
|
||||
Reference in New Issue
Block a user