refactory feeds

This commit is contained in:
stubbfel
2013-10-14 18:22:05 +02:00
parent cfcfd20956
commit 67a56535ba
17 changed files with 346 additions and 366 deletions

View File

@@ -1,10 +1,11 @@
//-----------------------------------------------------------------------
// <copyright file="DepartmentFeed.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>fiedlchr</author>
// <sience>24.06.2013</sience>
//----------------------------------------------------------------------
// <date>14.10.2013</date>
// <summary>Implements the department feed class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Departments
{
using System;
@@ -14,18 +15,17 @@ namespace CampusAppWP8.Feed.Departments
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Model.Departments;
/// <summary>
/// Feed class for the department information.
/// </summary>
/// <summary> Feed class for the department information. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWPortalLib8.Model.Departments.DepartmentModel}"/>
public class DepartmentFeed : XmlModel<DepartmentModel>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="DepartmentFeed" /> class.
/// </summary>
/// <param name="autoLoad">automatic loading of the data</param>
/// <summary> Initializes a new instance of the <see cref="DepartmentFeed" /> class. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="autoLoad"> (Optional) automatic loading of the data. </param>
public DepartmentFeed(bool autoLoad = true)
: base(ModelType.FileAndFeed, Constants.FileDepartment_Name, Constants.UrlDepartment_Addr)
{
@@ -44,11 +44,10 @@ namespace CampusAppWP8.Feed.Departments
#region Method
/// <summary>
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <param name="model">model object</param>
/// <returns>true, if model is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <returns> true, if model is up-to-date, otherwise false. </returns>
private bool CheckIsModelUpToDate(DepartmentModel model)
{
bool retValue = true;
@@ -65,12 +64,11 @@ namespace CampusAppWP8.Feed.Departments
return retValue;
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <param name="model">model object</param>
/// <param name="info">file info object</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <param name="info"> file info object. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnLoad(DepartmentModel model, FileInfo info)
{
bool retValue = true;
@@ -87,12 +85,11 @@ namespace CampusAppWP8.Feed.Departments
return retValue;
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <param name="model">model object</param>
/// <param name="info">file info object</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <param name="info"> file info object. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnSave(DepartmentModel model, FileInfo info)
{
bool retValue = true;
@@ -112,10 +109,10 @@ namespace CampusAppWP8.Feed.Departments
return retValue;
}
/// <summary>Check if the model or file is up-to-date.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
/// <param name="lastModified">Date of the last modification.</param>
/// <returns>true, if is up-to-date, otherwise false.</returns>
/// <summary> Check if the model or file is up-to-date. </summary>
/// <remarks> fiedlchr, 12.09.2013. </remarks>
/// <param name="lastModified"> Date of the last modification. </param>
/// <returns> true, if is up-to-date, otherwise false. </returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 30);

View File

@@ -1,10 +1,11 @@
//-----------------------------------------------------------------------
// <copyright file="EventFeed.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>fiedlchr</author>
// <sience>24.06.2013</sience>
//----------------------------------------------------------------------
// <date>14.10.2013</date>
// <summary>Implements the event feed class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Events
{
using System;
@@ -15,17 +16,16 @@ namespace CampusAppWP8.Feed.Events
using CampusAppWPortalLib8.Model.RSS;
using CampusAppWPortalLib8.Model;
/// <summary>
/// Event Feed.
/// </summary>
/// <summary> Event Feed. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWPortalLib8.Model.RSS.RSSViewModel}"/>
public class EventFeed : XmlModel<RSSViewModel>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="EventFeed" /> class.
/// </summary>
/// <param name="autoLoad">automatic loading of the data</param>
/// <summary> Initializes a new instance of the <see cref="EventFeed" /> class. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="autoLoad"> (Optional) automatic loading of the data. </param>
public EventFeed(bool autoLoad = true)
: base(ModelType.FileAndFeed, Constants.FileEvents_Name, CampusAppWPortalLib8.Resources.Constants.UrlEvents_Addr)
{
@@ -43,11 +43,10 @@ namespace CampusAppWP8.Feed.Events
#region Method
/// <summary>
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>
/// </summary>
/// <param name="model">model object</param>
/// <returns>true, if model is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/> </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <returns> true, if model is up-to-date, otherwise false. </returns>
private bool CheckIsModelUpToDate(RSSViewModel model)
{
bool retValue = true;
@@ -64,12 +63,11 @@ namespace CampusAppWP8.Feed.Events
return retValue;
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>
/// </summary>
/// <param name="model">model object</param>
/// <param name="info">file info object</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/> </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <param name="info"> file info object. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnLoad(RSSViewModel model, FileInfo info)
{
bool retValue = true;
@@ -86,12 +84,11 @@ namespace CampusAppWP8.Feed.Events
return retValue;
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>
/// </summary>
/// <param name="model">model object</param>
/// <param name="info">file info object</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/> </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <param name="info"> file info object. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnSave(RSSViewModel model, FileInfo info)
{
bool retValue = true;
@@ -111,10 +108,10 @@ namespace CampusAppWP8.Feed.Events
return retValue;
}
/// <summary>Check if the model or file is up-to-date.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
/// <param name="lastModified">Date of the last modification.</param>
/// <returns>true, if is up-to-date, otherwise false.</returns>
/// <summary> Check if the model or file is up-to-date. </summary>
/// <remarks> fiedlchr, 12.09.2013. </remarks>
/// <param name="lastModified"> Date of the last modification. </param>
/// <returns> true, if is up-to-date, otherwise false. </returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 1.0);

View File

@@ -1,10 +1,11 @@
//-----------------------------------------------------------------------
// <copyright file="ExamFeed.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>02.09.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the exam feed class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Exams
{
using System.IO;
@@ -14,14 +15,15 @@ namespace CampusAppWP8.Feed.Exams
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>Exam feed.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
/// <summary> Exam feed. </summary>
/// <remarks> Stubbfel, 02.09.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWP8.Model.Exams.ExamListWp8Model}"/>
public class ExamFeed : XmlModel<ExamListWp8Model>
{
#region Constructor
/// <summary>Initializes a new instance of the ExamFeed class.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
/// <summary> Initializes a new instance of the ExamFeed class. </summary>
/// <remarks> Stubbfel, 02.09.2013. </remarks>
public ExamFeed()
: base(ModelType.FileAndFeed, Constants.FileExamApp_ExamFeed, Constants.UrlExamApp_ExamFeed)
{
@@ -35,10 +37,10 @@ namespace CampusAppWP8.Feed.Exams
#region Method
/// <summary>Check is model up to date.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
/// <param name="model">The model.</param>
/// <returns>true if it succeeds, false if it fails.</returns>
/// <summary> Check is model up to date. </summary>
/// <remarks> Stubbfel, 02.09.2013. </remarks>
/// <param name="model"> The model. </param>
/// <returns> true if it succeeds, false if it fails. </returns>
private bool CheckIsModelUpToDate(ExamListWp8Model model)
{
if (model == null)
@@ -49,11 +51,11 @@ namespace CampusAppWP8.Feed.Exams
return true;
}
/// <summary>Check is file up to date.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
/// <param name="model"> The model.</param>
/// <param name="fileInfo">Information describing the file.</param>
/// <returns>true if it succeeds, false if it fails.</returns>
/// <summary> Check is file up to date. </summary>
/// <remarks> Stubbfel, 02.09.2013. </remarks>
/// <param name="model"> The model. </param>
/// <param name="fileInfo"> Information describing the file. </param>
/// <returns> true if it succeeds, false if it fails. </returns>
private bool CheckIsFileUpToDate(ExamListWp8Model model, FileInfo fileInfo)
{
if (fileInfo == null || !fileInfo.Exists || fileInfo.Length < 1)

View File

@@ -1,10 +1,11 @@
//-----------------------------------------------------------------------
// <copyright file="ClubLinkFeed.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>02.07.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the club link feed class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Link
{
using System;
@@ -15,16 +16,15 @@ namespace CampusAppWP8.Feed.Link
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for ClubLinkFeeds
/// </summary>
/// <summary> This Class is for ClubLinkFeeds. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWPortalLib8.Model.Link.LinkListModel}"/>
public class ClubLinkFeed : XmlModel<LinkListModel>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="ClubLinkFeed" /> class.
/// </summary>
/// <summary> Initializes a new instance of the <see cref="ClubLinkFeed" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public ClubLinkFeed()
: base(ModelType.FileAndFeed, Constants.FileLink_ClubLinks, Constants.UrlLink_ClubLinks)
{
@@ -37,11 +37,10 @@ namespace CampusAppWP8.Feed.Link
#region Method
/// <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>
/// <summary> Method check if the FeedModel is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="model"> reference of the FeedModel. </param>
/// <returns> true, if model is up-to-date, otherwise false. </returns>
private bool CheckIsModelUpToDate(LinkListModel model)
{
if (model == null)
@@ -53,12 +52,11 @@ namespace CampusAppWP8.Feed.Link
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>
/// <summary> Method check if the FeedFile is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <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(LinkListModel model, FileInfo fileInfo)
{
if (fileInfo == null || !fileInfo.Exists || fileInfo.Length < 1)
@@ -70,11 +68,10 @@ namespace CampusAppWP8.Feed.Link
return this.CheckIsUpToDate(lastModified);
}
/// <summary>
/// Check if the model or file is up-to-date.
/// </summary>
/// <param name="lastModified">Date of the last modification</param>
/// <returns>true, if is up-to-date, otherwise false</returns>
/// <summary> Check if the model or file is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="lastModified"> Date of the last modification. </param>
/// <returns> true, if is up-to-date, otherwise false. </returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 7.0);

View File

@@ -1,10 +1,11 @@
//-----------------------------------------------------------------------
// <copyright file="CommonLinkFeed.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>02.07.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the common link feed class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Link
{
using System;
@@ -15,16 +16,15 @@ namespace CampusAppWP8.Feed.Link
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for CommonLinkFeeds
/// </summary>
/// <summary> This Class is for CommonLinkFeeds. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWPortalLib8.Model.Link.LinkListModel}"/>
public class CommonLinkFeed : XmlModel<LinkListModel>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="CommonLinkFeed" /> class.
/// </summary>
/// <summary> Initializes a new instance of the <see cref="CommonLinkFeed" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public CommonLinkFeed()
: base(ModelType.FileAndFeed, Constants.FileLink_CommonLinks, Constants.UrlLink_CommonLinks)
{
@@ -37,11 +37,10 @@ namespace CampusAppWP8.Feed.Link
#region Method
/// <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>
/// <summary> Method check if the FeedModel is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="model"> reference of the FeedModel. </param>
/// <returns> true, if model is up-to-date, otherwise false. </returns>
private bool CheckIsModelUpToDate(LinkListModel model)
{
if (model == null)
@@ -53,12 +52,11 @@ namespace CampusAppWP8.Feed.Link
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>
/// <summary> Method check if the FeedFile is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <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(LinkListModel model, FileInfo fileInfo)
{
if (fileInfo == null || !fileInfo.Exists || fileInfo.Length < 1)
@@ -70,11 +68,10 @@ namespace CampusAppWP8.Feed.Link
return this.CheckIsUpToDate(lastModified);
}
/// <summary>
/// Check if the model or file is up-to-date.
/// </summary>
/// <param name="lastModified">Date of the last modification</param>
/// <returns>true, if is up-to-date, otherwise false</returns>
/// <summary> Check if the model or file is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="lastModified"> Date of the last modification. </param>
/// <returns> true, if is up-to-date, otherwise false. </returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 7.0);

View File

@@ -1,10 +1,11 @@
//-----------------------------------------------------------------------
// <copyright file="MensaFeed.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>03.05.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the mensa feed class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Mensa
{
using System;
@@ -13,18 +14,17 @@ namespace CampusAppWP8.Feed.Mensa
using CampusAppWPortalLib8.Model.Mensa;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for MensaFeeds
/// </summary>
/// <summary> This Class is for MensaFeeds. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWPortalLib8.Model.Mensa.MenuWeekModel}"/>
public abstract class MensaFeed : XmlModel<MenuWeekModel>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="MensaFeed" /> class.
/// </summary>
/// <param name="fileName">name of the file</param>
/// <param name="feedUrl">url of the feed</param>
/// <summary> Initializes a new instance of the <see cref="MensaFeed" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="fileName"> name of the file. </param>
/// <param name="feedUrl"> url of the feed. </param>
protected MensaFeed(string fileName, string feedUrl)
: base(ModelType.FileAndFeed, fileName, feedUrl)
{
@@ -37,8 +37,8 @@ namespace CampusAppWP8.Feed.Mensa
#region Property
/// <summary>Gets or sets the title.</summary>
/// <value>The title.</value>
/// <summary> Gets the title. </summary>
/// <value> The title. </value>
public string Title { get; protected set; }
#endregion
@@ -47,11 +47,10 @@ namespace CampusAppWP8.Feed.Mensa
#region public
/// <summary>
/// Method creates a MensaFeed depends of certain Campus
/// </summary>
/// <param name="campus"> camus parameter </param>
/// <returns> the correct mensaFeed</returns>
/// <summary> Method creates a MensaFeed depends of certain Campus. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="campus"> camus parameter. </param>
/// <returns> the correct mensaFeed. </returns>
public static MensaFeed CreateCampusMensaFeed(CampusAppWPortalLib8.Model.Settings.Campus campus)
{
switch (campus)
@@ -73,11 +72,10 @@ namespace CampusAppWP8.Feed.Mensa
#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>
/// <summary> Method check if the FeedModel is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="model"> reference of the FeedModel. </param>
/// <returns> true, if model is up-to-date, otherwise false. </returns>
private bool CheckIsModelUpToDate(MenuWeekModel model)
{
if (model == null)
@@ -89,12 +87,11 @@ namespace CampusAppWP8.Feed.Mensa
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>
/// <summary> Method check if the FeedFile is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <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(MenuWeekModel model, FileInfo fileInfo)
{
if (fileInfo == null || !fileInfo.Exists || fileInfo.Length < 1)
@@ -106,11 +103,10 @@ namespace CampusAppWP8.Feed.Mensa
return this.CheckIsUpToDate(lastModified);
}
/// <summary>
/// Method check if the last modification was later as the NewMenuWeekDay
/// </summary>
/// <param name="lastModified">Date of the last modification</param>
/// <returns>true, if is up-to-date, otherwise false</returns>
/// <summary> Method check if the last modification was later as the NewMenuWeekDay. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="lastModified"> Date of the last modification. </param>
/// <returns> true, if is up-to-date, otherwise false. </returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
int diff = lastModified.CompareTo(MenuWeekModel.CalcFirstWeekDay());

View File

@@ -1,24 +1,24 @@
//-----------------------------------------------------------------------
// <copyright file="MensaFeedCBMain.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>12.08.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the mensa feed cb main class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Mensa
{
using CampusAppWP8.Resources;
/// <summary>
/// MensaFeed for main campus of cottbus
/// </summary>
/// <summary> MensaFeed for main campus of cottbus. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Feed.Mensa.MensaFeed"/>
public class MensaFeedCBMain : MensaFeed
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="MensaFeedCBMain" /> class.
/// </summary>
/// <summary> Initializes a new instance of the <see cref="MensaFeedCBMain" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public MensaFeedCBMain()
: base(Constants.FileMensa_Shedule_CBMain, CampusAppWPortalLib8.Resources.Constants.UrlMensa_Week_CBMain)
{

View File

@@ -1,24 +1,24 @@
//-----------------------------------------------------------------------
// <copyright file="MensaFeedCBNorth.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>12.08.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the mensa feed cb north class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Mensa
{
using CampusAppWP8.Resources;
/// <summary>
/// MensaFeed for main campus of cottbus
/// </summary>
/// <summary> MensaFeed for main campus of cottbus. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Feed.Mensa.MensaFeed"/>
public class MensaFeedCBNorth : MensaFeed
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="MensaFeedCBNorth" /> class.
/// </summary>
/// <summary> Initializes a new instance of the <see cref="MensaFeedCBNorth" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public MensaFeedCBNorth()
: base(Constants.FileMensa_Shedule_CBNorth, CampusAppWPortalLib8.Resources.Constants.UrlMensa_Week_CBNorth)
{

View File

@@ -1,24 +1,24 @@
//-----------------------------------------------------------------------
// <copyright file="MensaFeedCBSouth.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>12.08.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the mensa feed cb south class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Mensa
{
using CampusAppWP8.Resources;
/// <summary>
/// MensaFeed for main campus of cottbus
/// </summary>
/// <summary> MensaFeed for main campus of cottbus. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Feed.Mensa.MensaFeed"/>
public class MensaFeedCBSouth : MensaFeed
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="MensaFeedCBSouth" /> class.
/// </summary>
/// <summary> Initializes a new instance of the <see cref="MensaFeedCBSouth" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public MensaFeedCBSouth()
: base(Constants.FileMensa_Shedule_CBSouth, CampusAppWPortalLib8.Resources.Constants.UrlMensa_Week_CBSouth)
{

View File

@@ -1,24 +1,24 @@
//-----------------------------------------------------------------------
// <copyright file="MensaFeedSBFMain.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>12.08.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the mensa feed sbf main class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Mensa
{
using CampusAppWP8.Resources;
/// <summary>
/// MensaFeed for main campus of cottbus
/// </summary>
/// <summary> MensaFeed for main campus of cottbus. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Feed.Mensa.MensaFeed"/>
public class MensaFeedSBFMain : MensaFeed
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="MensaFeedSBFMain" /> class.
/// </summary>
/// <summary> Initializes a new instance of the <see cref="MensaFeedSBFMain" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public MensaFeedSBFMain()
: base(Constants.FileMensa_Shedule_SBFMain, CampusAppWPortalLib8.Resources.Constants.UrlMensa_Week_SBFMain)
{

View File

@@ -1,10 +1,11 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------
// <copyright file="NewsFeed.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>fiedlchr</author>
// <sience>24.06.2013</sience>
//-----------------------------------------------------------------------------
// <date>14.10.2013</date>
// <summary>Implements the news feed class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.News
{
using System;
@@ -15,17 +16,16 @@ namespace CampusAppWP8.Feed.News
using CampusAppWPortalLib8.Model.RSS;
using CampusAppWPortalLib8.Model;
/// <summary>
/// News Feed.
/// </summary>
/// <summary> News Feed. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWPortalLib8.Model.RSS.RSSViewModel}"/>
public class NewsFeed : XmlModel<RSSViewModel>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="NewsFeed" /> class.
/// </summary>
/// <param name="autoLoad">automatic loading of the data</param>
/// <summary> Initializes a new instance of the <see cref="NewsFeed" /> class. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="autoLoad"> (Optional) automatic loading of the data. </param>
public NewsFeed(bool autoLoad = true)
: base(ModelType.FileAndFeed, Constants.FileNews_Name, CampusAppWPortalLib8.Resources.Constants.UrlNews_Addr)
{
@@ -43,11 +43,10 @@ namespace CampusAppWP8.Feed.News
#region Method
/// <summary>
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>
/// </summary>
/// <param name="model">model object</param>
/// <returns>true, if model is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/> </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <returns> true, if model is up-to-date, otherwise false. </returns>
private bool CheckIsModelUpToDate(RSSViewModel model)
{
bool retValue = true;
@@ -64,12 +63,11 @@ namespace CampusAppWP8.Feed.News
return retValue;
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>
/// </summary>
/// <param name="model">model object</param>
/// <param name="info">info object of the file</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/> </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <param name="info"> info object of the file. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnLoad(RSSViewModel model, FileInfo info)
{
bool retValue = true;
@@ -84,13 +82,12 @@ namespace CampusAppWP8.Feed.News
return retValue;
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>
/// </summary>
/// <param name="model">model object</param>
/// <param name="info">info object of the file</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/> </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <param name="info"> info object of the file. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnSave(RSSViewModel model, FileInfo info)
{
bool retValue = true;
@@ -110,10 +107,10 @@ namespace CampusAppWP8.Feed.News
return retValue;
}
/// <summary>Check if the model or file is up-to-date.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
/// <param name="lastModified">Date of the last modification.</param>
/// <returns>true, if is up-to-date, otherwise false.</returns>
/// <summary> Check if the model or file is up-to-date. </summary>
/// <remarks> fiedlchr, 12.09.2013. </remarks>
/// <param name="lastModified"> Date of the last modification. </param>
/// <returns> true, if is up-to-date, otherwise false. </returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 1.0);

View File

@@ -1,10 +1,11 @@
//-----------------------------------------------------------------------
// <copyright file="OpeninghoursFeed.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>fiedlchr</author>
// <sience>24.06.2013</sience>
//----------------------------------------------------------------------
// <date>14.10.2013</date>
// <summary>Implements the openinghours feed class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Openinghours
{
using System;
@@ -14,17 +15,16 @@ namespace CampusAppWP8.Feed.Openinghours
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for MesaFeeds
/// </summary>
/// <summary> This Class is for MesaFeeds. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWP8.Model.Openinghours.OpeninghoursWp8Model}"/>
public class OpeninghoursFeed : XmlModel<OpeninghoursWp8Model>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="OpeninghoursFeed" /> class.
/// </summary>
/// <summary> Initializes a new instance of the <see cref="OpeninghoursFeed" /> class. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
public OpeninghoursFeed()
: base(ModelType.FileAndFeed, Constants.FileOpeningHours_OpeningHours, Constants.UrlOpeningHours_OpeningHours)
{
@@ -37,11 +37,10 @@ namespace CampusAppWP8.Feed.Openinghours
#region Method
/// <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>
/// <summary> Method check if the FeedModel is up-to-date. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> reference of the FeedModel. </param>
/// <returns> true, if model is up-to-date, otherwise false. </returns>
private bool CheckIsModelUpToDate(OpeninghoursWp8Model model)
{
bool retValue = true;
@@ -58,12 +57,11 @@ namespace CampusAppWP8.Feed.Openinghours
return retValue;
}
/// <summary>
/// Method check if the FeedFile is up-to-date
/// </summary>
/// <param name="model">reference of the FeedModel</param>
/// <param name="info">info about the file</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method check if the FeedFile is up-to-date. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> reference of the FeedModel. </param>
/// <param name="info"> info about the file. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnLoad(OpeninghoursWp8Model model, FileInfo info)
{
bool retValue = true;
@@ -79,12 +77,11 @@ namespace CampusAppWP8.Feed.Openinghours
return retValue;
}
/// <summary>
/// Method check if the FeedFile is up-to-date
/// </summary>
/// <param name="model">reference of the FeedModel</param>
/// <param name="info">info about the file</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method check if the FeedFile is up-to-date. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> reference of the FeedModel. </param>
/// <param name="info"> info about the file. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnSave(OpeninghoursWp8Model model, FileInfo info)
{
bool retValue = true;
@@ -103,10 +100,10 @@ namespace CampusAppWP8.Feed.Openinghours
return retValue;
}
/// <summary>Check if the model or file is up-to-date.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
/// <param name="lastModified">Date of the last modification.</param>
/// <returns>true, if is up-to-date, otherwise false.</returns>
/// <summary> Check if the model or file is up-to-date. </summary>
/// <remarks> fiedlchr, 12.09.2013. </remarks>
/// <param name="lastModified"> Date of the last modification. </param>
/// <returns> true, if is up-to-date, otherwise false. </returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 7.0);

View File

@@ -15,16 +15,15 @@ namespace CampusAppWP8.Feed.StudentCouncil
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for StudentCouncilFeed
/// </summary>
/// <summary> This Class is for StudentCouncilFeed. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWPortalLib8.Model.StudentCouncil.StudentCouncilListModel}"/>
public class StudentCouncilFeed : XmlModel<StudentCouncilListModel>
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="StudentCouncilFeed" /> class.
/// </summary>
/// <summary> Initializes a new instance of the <see cref="StudentCouncilFeed" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public StudentCouncilFeed()
: base(ModelType.FileAndFeed, Constants.FileStudentCouncil_StudentCouncils, Constants.UrlStudentCouncil_StudentCouncils)
{
@@ -37,11 +36,10 @@ namespace CampusAppWP8.Feed.StudentCouncil
#region Method
/// <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>
/// <summary> Method check if the FeedModel is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="model"> reference of the FeedModel. </param>
/// <returns> true, if model is up-to-date, otherwise false. </returns>
private bool CheckIsModelUpToDate(StudentCouncilListModel model)
{
if (model == null)
@@ -53,12 +51,11 @@ namespace CampusAppWP8.Feed.StudentCouncil
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>
/// <summary> Method check if the FeedFile is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <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(StudentCouncilListModel model, FileInfo fileInfo)
{
if (fileInfo == null || !fileInfo.Exists || fileInfo.Length < 1)
@@ -70,11 +67,10 @@ namespace CampusAppWP8.Feed.StudentCouncil
return this.CheckIsUpToDate(lastModified);
}
/// <summary>
/// Check if the model or file is up-to-date.
/// </summary>
/// <param name="lastModified">Date of the last modification</param>
/// <returns>true, if is up-to-date, otherwise false</returns>
/// <summary> Check if the model or file is up-to-date. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="lastModified"> Date of the last modification. </param>
/// <returns> true, if is up-to-date, otherwise false. </returns>
private bool CheckIsUpToDate(DateTime lastModified)
{
return Utilities.DayDifference(Utilities.DifferenceType.Less, lastModified, 7.0);

View File

@@ -1,16 +1,18 @@
//-----------------------------------------------------------------------
// <copyright file="CourseFeed.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>02.09.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the course feed class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Feed.Utility
{
using CampusAppWP8.Feed.Exams;
/// <summary>Course Feed.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
/// <summary> Course Feed. </summary>
/// <remarks> Stubbfel, 02.09.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Feed.Exams.ExamFeed"/>
public class CourseFeed : ExamFeed
{
}

View File

@@ -1,10 +1,11 @@
//-----------------------------------------------------------------------
// <copyright file="DepartmentFavoriteFile.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>fiedlchr</author>
// <sience>01.07.2013</sience>
//----------------------------------------------------------------------
// <date>14.10.2013</date>
// <summary>Implements the department favorite file class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.File.Departments
{
using System.IO;
@@ -13,16 +14,16 @@ namespace CampusAppWP8.File.Departments
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Model.Departments;
/// <summary>
/// Feed object to handle favorite department feeds.
/// </summary>
/// <summary> Feed object to handle favorite department feeds. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWPortalLib8.Model.Departments.DepartmentModel}"/>
public class DepartmentFavoriteFile : XmlModel<DepartmentModel>
{
#region Constructor
/// <summary>Initializes a new instance of the DepartmentFavoriteFile class.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
/// <param name="autoLoad">(Optional) the automatic load.</param>
/// <summary> Initializes a new instance of the DepartmentFavoriteFile class. </summary>
/// <remarks> fiedlchr, 12.09.2013. </remarks>
/// <param name="autoLoad"> (Optional) the automatic load. </param>
public DepartmentFavoriteFile(bool autoLoad = true)
: base(ModelType.File, Constants.FileDepartment_Favorite_Name, string.Empty)
{
@@ -40,11 +41,10 @@ namespace CampusAppWP8.File.Departments
#region Method
/// <summary>
/// Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <param name="model">model object</param>
/// <returns>true, if model is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsModelUpToDate()-Method <see cref="Pages"/>. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <returns> true, if model is up-to-date, otherwise false. </returns>
private bool CheckIsModelUpToDate(DepartmentModel model)
{
bool retValue = true;
@@ -59,12 +59,11 @@ namespace CampusAppWP8.File.Departments
return retValue;
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <param name="model">model object</param>
/// <param name="info">file info object</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <param name="info"> file info object. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnLoad(DepartmentModel model, FileInfo info)
{
bool retValue = false;
@@ -77,12 +76,11 @@ namespace CampusAppWP8.File.Departments
return retValue;
}
/// <summary>
/// Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>.
/// </summary>
/// <param name="model">model object</param>
/// <param name="info">file info object</param>
/// <returns>true, if file is up-to-date, otherwise false</returns>
/// <summary> Method implement CheckIsFileUpToDate()-Method <see cref="Pages"/>. </summary>
/// <remarks> fiedlchr, 14.10.2013. </remarks>
/// <param name="model"> model object. </param>
/// <param name="info"> file info object. </param>
/// <returns> true, if file is up-to-date, otherwise false. </returns>
private bool CheckIsFileUpToDateOnSave(DepartmentModel model, FileInfo info)
{
bool retValue = false;

View File

@@ -1,34 +1,35 @@
//-----------------------------------------------------------------------
// <copyright file="ExamFile.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>03.09.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the exam file class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.File.Exams
{
using System.IO;
using CampusAppWP8.Model;
using Windows.Storage;
/// <summary>Exam file.</summary>
/// <remarks>Stubbfel, 03.09.2013.</remarks>
/// <summary> Exam file. </summary>
/// <remarks> Stubbfel, 03.09.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.BinaryModel"/>
public class ExamFile : BinaryModel
{
#region Member
/// <summary>The storage file.</summary>
/// <summary> The storage file. </summary>
private StorageFile storageFile;
#endregion
#region Constructor
/// <summary>Initializes a new instance of the ExamFile class.</summary>
/// <remarks>Stubbfel, 03.09.2013.</remarks>
/// <param name="fileName">Filename of the file.</param>
/// <param name="url"> URL of the document.</param>
/// <summary> Initializes a new instance of the ExamFile class. </summary>
/// <remarks> Stubbfel, 03.09.2013. </remarks>
/// <param name="fileName"> Filename of the file. </param>
/// <param name="url"> URL of the document. </param>
public ExamFile(string fileName, string url)
: base(CampusAppWPortalLib8.Model.ModelType.FileAndFeed, fileName, url)
{
@@ -46,6 +47,9 @@ namespace CampusAppWP8.File.Exams
/// <summary>Executes the file operation.</summary>
/// <remarks>Stubbfel, 03.09.2013.</remarks>
#pragma warning disable 4014
/// <summary> Executes the file operation. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public async void LaunchFile()
{
if (this.storageFile == null)
@@ -62,8 +66,8 @@ namespace CampusAppWP8.File.Exams
#endregion
/// <summary>Saves the and launch file.</summary>
/// <remarks>Stubbfel, 03.09.2013.</remarks>
/// <summary> Saves the and launch file. </summary>
/// <remarks> Stubbfel, 03.09.2013. </remarks>
public void SaveAndLaunchFile()
{
if (this.File.Exist())
@@ -79,10 +83,10 @@ namespace CampusAppWP8.File.Exams
#region private
/// <summary>Check is model up to date.</summary>
/// <remarks>Stubbfel, 03.09.2013.</remarks>
/// <param name="model">The model.</param>
/// <returns>true if it succeeds, false if it fails.</returns>
/// <summary> Check is model up to date. </summary>
/// <remarks> Stubbfel, 03.09.2013. </remarks>
/// <param name="model"> The model. </param>
/// <returns> true if it succeeds, false if it fails. </returns>
private bool CheckIsModelUpToDate(byte[] model)
{
if (model == null)
@@ -93,11 +97,11 @@ namespace CampusAppWP8.File.Exams
return true;
}
/// <summary>Check is file up to date.</summary>
/// <remarks>Stubbfel, 03.09.2013.</remarks>
/// <param name="model"> The model.</param>
/// <param name="fileInfo">Information describing the file.</param>
/// <returns>true if it succeeds, false if it fails.</returns>
/// <summary> Check is file up to date. </summary>
/// <remarks> Stubbfel, 03.09.2013. </remarks>
/// <param name="model"> The model. </param>
/// <param name="fileInfo"> Information describing the file. </param>
/// <returns> true if it succeeds, false if it fails. </returns>
private bool CheckIsFileUpToDate(byte[] model, FileInfo fileInfo)
{
if (fileInfo == null || !fileInfo.Exists || fileInfo.Length < 1 || model != null)

View File

@@ -1,11 +1,11 @@
//-----------------------------------------------------------------------
// <copyright file="PlacesFile.cs" company="BTU/IIT">
// Company copyright tag.
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>stubbfel</author>
// <sience>09.09.2013</sience>
//----------------------------------------------------------------------
// <author>Stubbfel</author>
// <date>14.10.2013</date>
// <summary>Implements the places file class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.File.Places
{
using CampusAppWP8.Model;
@@ -13,14 +13,15 @@ namespace CampusAppWP8.File.Places
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Utility;
/// <summary>Places file.</summary>
/// <remarks>Stubbfel, 09.09.2013.</remarks>
/// <summary> Places file. </summary>
/// <remarks> Stubbfel, 09.09.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWP8.Model.GeoDb.SpsModel}"/>
public class PlacesFile : XmlModel<SpsModel>
{
#region Constructor
/// <summary>Initializes a new instance of the PlacesFile class.</summary>
/// <remarks>Stubbfel, 09.09.2013.</remarks>
/// <summary> Initializes a new instance of the PlacesFile class. </summary>
/// <remarks> Stubbfel, 09.09.2013. </remarks>
public PlacesFile()
: base(CampusAppWPortalLib8.Model.ModelType.File, Constants.FilePlace_AllPlaces)
{
@@ -33,11 +34,11 @@ namespace CampusAppWP8.File.Places
#region Method
/// <summary>Check is file up to date.</summary>
/// <remarks>Stubbfel, 09.09.2013.</remarks>
/// <param name="model"> The model.</param>
/// <param name="fileInfo">Information describing the file.</param>
/// <returns>true if it succeeds, false if it fails.</returns>
/// <summary> Check is file up to date. </summary>
/// <remarks> Stubbfel, 09.09.2013. </remarks>
/// <param name="model"> The model. </param>
/// <param name="fileInfo"> Information describing the file. </param>
/// <returns> true if it succeeds, false if it fails. </returns>
private bool CheckIsFileUpToDate(SpsModel model, System.IO.FileInfo fileInfo)
{
if (fileInfo == null || !fileInfo.Exists || fileInfo.Length < 1 || (model != null && model.HasChanged))
@@ -48,9 +49,8 @@ namespace CampusAppWP8.File.Places
return false;
}
/// <summary>
/// Method load OfflineMap as Fallback
/// </summary>
/// <summary> Method load OfflineMap as Fallback. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public void FallBackLoad()
{
SpsModel fallBackModel = XmlManager.DeserializationFileToModel<SpsModel>(Constants.FileMap_OfflineMap);