diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
index 3fdb572d..6854c997 100644
--- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
+++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj
@@ -96,6 +96,8 @@
App.xaml
+
+
@@ -113,6 +115,8 @@
+
+
@@ -149,6 +153,9 @@
ResultPage.xaml
+
+ LinkPage.xaml
+
MensaPage.xaml
@@ -238,6 +245,10 @@
MSBuild:Compile
Designer
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
diff --git a/CampusAppWP8/CampusAppWP8/Feed/Link/ClubLinkFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/Link/ClubLinkFeed.cs
new file mode 100644
index 00000000..c34b5f5a
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Feed/Link/ClubLinkFeed.cs
@@ -0,0 +1,83 @@
+//-----------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 02.07.2013
+//----------------------------------------------------------------------
+namespace CampusAppWP8.Feed.Link
+{
+ using System;
+ using CampusAppWP8.Model.Link;
+ using CampusAppWP8.Resources;
+ using CampusAppWP8.Utility;
+
+ ///
+ /// This Class is for ClubLinkFeeds
+ ///
+ public class ClubLinkFeed : XmlFeed
+ {
+ #region Constructor
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ClubLinkFeed()
+ : base(new Uri(Constants.UrlLink_ClubLinks, UriKind.Absolute), Constants.FileLink_ClubLinks)
+ {
+ }
+
+ #endregion
+
+ #region Method
+
+ #region Protected
+
+ ///
+ /// Method implement CheckIsModelUpToDate()-Method .
+ ///
+ /// true, if model is up-to-date, otherwise false
+ protected override bool CheckIsModelUpToDate()
+ {
+ DateTime lastModified = this.Model.CreateTime;
+ return this.CheckIsUpToDate(lastModified);
+ }
+
+ ///
+ /// Method implement CheckIsFileUpToDate()-Method .
+ ///
+ /// true, if file is up-to-date, otherwise false
+ protected override bool CheckIsFileUpToDate()
+ {
+ DateTime lastModified = FileManager.GetFileInfo(FileName).LastWriteTime;
+ return this.CheckIsUpToDate(lastModified);
+ }
+
+ #endregion
+
+ #region Private
+
+ ///
+ /// Check if the model or file is up-to-date.
+ ///
+ /// Date of the last modification
+ /// true, if is up-to-date, otherwise false
+ private bool CheckIsUpToDate(DateTime lastModified)
+ {
+ DateTime temp = lastModified.AddDays(1);
+
+ int diff = temp.CompareTo(DateTime.Now);
+
+ if (diff < 0)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ #endregion
+
+ #endregion
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/Feed/Link/CommonLinkFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/Link/CommonLinkFeed.cs
new file mode 100644
index 00000000..d1bd538c
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Feed/Link/CommonLinkFeed.cs
@@ -0,0 +1,83 @@
+//-----------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 02.07.2013
+//----------------------------------------------------------------------
+namespace CampusAppWP8.Feed.Link
+{
+ using System;
+ using CampusAppWP8.Model.Link;
+ using CampusAppWP8.Resources;
+ using CampusAppWP8.Utility;
+
+ ///
+ /// This Class is for CommonLinkFeeds
+ ///
+ public class CommonLinkFeed : XmlFeed
+ {
+ #region Constructor
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public CommonLinkFeed()
+ : base(new Uri(Constants.UrlLink_CommonLinks, UriKind.Absolute), Constants.FileLink_CommonLinks)
+ {
+ }
+
+ #endregion
+
+ #region Method
+
+ #region Protected
+
+ ///
+ /// Method implement CheckIsModelUpToDate()-Method .
+ ///
+ /// true, if model is up-to-date, otherwise false
+ protected override bool CheckIsModelUpToDate()
+ {
+ DateTime lastModified = this.Model.CreateTime;
+ return this.CheckIsUpToDate(lastModified);
+ }
+
+ ///
+ /// Method implement CheckIsFileUpToDate()-Method .
+ ///
+ /// true, if file is up-to-date, otherwise false
+ protected override bool CheckIsFileUpToDate()
+ {
+ DateTime lastModified = FileManager.GetFileInfo(FileName).LastWriteTime;
+ return this.CheckIsUpToDate(lastModified);
+ }
+
+ #endregion
+
+ #region Private
+
+ ///
+ /// Check if the model or file is up-to-date.
+ ///
+ /// Date of the last modification
+ /// true, if is up-to-date, otherwise false
+ private bool CheckIsUpToDate(DateTime lastModified)
+ {
+ DateTime temp = lastModified.AddDays(1);
+
+ int diff = temp.CompareTo(DateTime.Now);
+
+ if (diff < 0)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ #endregion
+
+ #endregion
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs
index e1c85c4e..ef3405ee 100644
--- a/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs
+++ b/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs
@@ -13,7 +13,7 @@ namespace CampusAppWP8.Api.Mensa
using CampusAppWP8.Utility;
///
- /// This Class is for MesaFeeds
+ /// This Class is for MensaFeeds
///
public class MensaFeed : XmlFeed
{
diff --git a/CampusAppWP8/CampusAppWP8/Model/Link/LinkListModel.cs b/CampusAppWP8/CampusAppWP8/Model/Link/LinkListModel.cs
new file mode 100644
index 00000000..c512e9ea
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Model/Link/LinkListModel.cs
@@ -0,0 +1,64 @@
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 02.07.2013
+//-----------------------------------------------------------------------------
+
+namespace CampusAppWP8.Model.Link
+{
+ using System;
+ using System.Collections.ObjectModel;
+ using System.Xml.Serialization;
+
+ ///
+ /// Model for a list of links.
+ ///
+ [XmlRoot("root")]
+ public class LinkListModel
+ {
+ #region Member
+
+ ///
+ /// Time when the model was created.
+ ///
+ private readonly DateTime createTime;
+
+ #endregion
+
+ #region Constructor
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public LinkListModel()
+ {
+ this.createTime = DateTime.Now;
+ }
+
+ #endregion
+
+ #region Property
+
+ ///
+ /// Gets or sets feed information item list.
+ ///
+ [XmlArray("data")]
+ [XmlArrayItem("link")]
+ public ObservableCollection Links { get; set; }
+
+ ///
+ /// Gets the creation time of the model.
+ ///
+ public DateTime CreateTime
+ {
+ get
+ {
+ return this.createTime;
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/Model/Link/LinkModel.cs b/CampusAppWP8/CampusAppWP8/Model/Link/LinkModel.cs
new file mode 100644
index 00000000..fd36f338
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Model/Link/LinkModel.cs
@@ -0,0 +1,173 @@
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 02.07.2013
+//-----------------------------------------------------------------------------
+
+namespace CampusAppWP8.Model.Link
+{
+ using System.Globalization;
+ using System.Xml.Serialization;
+
+ ///
+ /// Model for menu
+ ///
+ public class LinkModel
+ {
+ #region Member
+
+ ///
+ /// German version of the link title.
+ ///
+ private string titleDE = string.Empty;
+
+ ///
+ /// English version of the link title.
+ ///
+ private string titleEN = string.Empty;
+
+ ///
+ /// German version of the link.
+ ///
+ private string linkDE = string.Empty;
+
+ ///
+ /// English version of the link.
+ ///
+ private string linkEN = string.Empty;
+
+ #endregion
+
+ #region Constructor
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public LinkModel()
+ {
+ }
+
+ #endregion
+
+ #region Property
+
+ ///
+ /// Gets or sets the german title of the link.
+ ///
+ [XmlAttribute("title_de")]
+ public string Title_DE
+ {
+ get
+ {
+ return this.titleDE;
+ }
+
+ set
+ {
+ if (value != this.titleDE)
+ {
+ this.titleDE = value;
+ }
+ }
+ }
+
+ ///
+ /// Gets or sets the english title of the link.
+ ///
+ [XmlAttribute("title_en")]
+ public string Title_EN
+ {
+ get
+ {
+ return this.titleEN;
+ }
+
+ set
+ {
+ this.titleEN = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the german link.
+ ///
+ [XmlAttribute("link_de")]
+ public string Link_DE
+ {
+ get
+ {
+ return this.linkDE;
+ }
+
+ set
+ {
+ if (value != this.linkDE)
+ {
+ this.linkDE = value;
+ }
+ }
+ }
+
+ ///
+ /// Gets or sets the english link.
+ ///
+ [XmlAttribute("link_en")]
+ public string Link_EN
+ {
+ get
+ {
+ return this.linkEN;
+ }
+
+ set
+ {
+ if (value != this.linkEN)
+ {
+ this.linkEN = value;
+ }
+ }
+ }
+
+ ///
+ /// Gets the localized title. If the phone is set to german language,
+ /// the german title will be returned otherwise the english title.
+ ///
+ public string Title
+ {
+ get
+ {
+ if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
+ {
+ return this.titleDE;
+ }
+ else
+ {
+ return this.titleEN;
+ }
+ }
+ }
+
+ ///
+ /// Gets the localized link. if the phone is set to german language,
+ /// the german comment will be returned otherwise the english link.
+ ///
+ public string Link
+ {
+ get
+ {
+ if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
+ {
+ return this.Link_DE;
+ }
+ else
+ {
+ return this.Link_EN;
+ }
+ }
+ }
+
+ #endregion
+ }
+}
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml
index f0454ac3..c17b9ab7 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml
@@ -22,13 +22,15 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -159,7 +161,7 @@
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml
index dfea3521..bc3d090b 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultDetailPage.xaml
@@ -22,7 +22,8 @@
-
+
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
index e82ed803..2f369ed6 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/ResultPage.xaml
@@ -13,39 +13,6 @@
mc:Ignorable="d"
shell:SystemTray.IsVisible="True">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -55,13 +22,9 @@
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs
new file mode 100644
index 00000000..3880dfde
--- /dev/null
+++ b/CampusAppWP8/CampusAppWP8/Pages/Links/LinkPage.xaml.cs
@@ -0,0 +1,177 @@
+//-----------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// stubbfel
+// 02.07.2013
+//----------------------------------------------------------------------
+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;
+
+ ///
+ /// Class for the LinkPage
+ ///
+ public partial class LinkPage : PhoneApplicationPage
+ {
+ #region Members
+
+ ///
+ /// the feed of the CommonLinks
+ ///
+ private CommonLinkFeed commonLinkFeed;
+
+ ///
+ /// the feed of the ClubLinks
+ ///
+ private ClubLinkFeed clubLinkFeed;
+
+ ///
+ /// how many feeds are currently loading
+ ///
+ private int loadingFeeds;
+
+ #endregion
+
+ #region Constructor
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public LinkPage()
+ {
+ this.InitializeComponent();
+ }
+
+ #endregion
+
+ #region Method
+
+ #region protected
+
+ ///
+ /// Override the OnNavigatedTo method
+ ///
+ /// Arguments of navigation
+ protected override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ base.OnNavigatedTo(e);
+
+ this.InitializeFeeds();
+ this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
+ this.loadingFeeds = 2;
+ this.commonLinkFeed.LoadFeed();
+ this.clubLinkFeed.LoadFeed();
+ }
+
+ #endregion
+ #region private
+
+ ///
+ /// Method initialize the Feeds
+ ///
+ private void InitializeFeeds()
+ {
+ if (this.commonLinkFeed == null)
+ {
+ this.InitializeCommonLinkFeed();
+ }
+
+ if (this.clubLinkFeed == null)
+ {
+ this.InitializeClubLinkFeed();
+ }
+ }
+
+ ///
+ /// Method initialize the CommonLinkFeed
+ ///
+ private void InitializeCommonLinkFeed()
+ {
+ this.commonLinkFeed = new CommonLinkFeed();
+ this.commonLinkFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.CommonLinkFeedIsReady);
+ }
+
+ ///
+ /// Method initialize the ClubLinkFeed
+ ///
+ private void InitializeClubLinkFeed()
+ {
+ this.clubLinkFeed = new ClubLinkFeed();
+ this.clubLinkFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.ClubLinkFeedIsReady);
+ }
+
+ ///
+ /// Method will be execute if the CommonLinkFeed is ready
+ ///
+ private void CommonLinkFeedIsReady()
+ {
+ this.SetupCommonPivot();
+ this.loadingFeeds--;
+
+ if (this.loadingFeeds < 1)
+ {
+ this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
+ }
+ }
+
+ ///
+ /// Method will be execute if the ClubLinkFeed is ready
+ ///
+ private void ClubLinkFeedIsReady()
+ {
+ this.SetupClubPivot();
+ this.loadingFeeds--;
+ if (this.loadingFeeds < 1)
+ {
+ this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
+ }
+ }
+
+ ///
+ /// Method set ItemSource for the CommonLinkPanel
+ ///
+ private void SetupCommonPivot()
+ {
+ this.CommonLinkPanel.ItemsSource = this.commonLinkFeed.Model.Links;
+ }
+
+ ///
+ /// Method set ItemSource for the ClubLinkPanel
+ ///
+ private void SetupClubPivot()
+ {
+ this.ClubLinkPanel.ItemsSource = this.clubLinkFeed.Model.Links;
+ }
+
+ ///
+ /// Method open the Link in IE
+ ///
+ /// clicked bottom
+ /// some RoutedEventArgs
+ private void LinkBtn_Click(object sender, RoutedEventArgs e)
+ {
+ FrameworkElement linkBtn = sender as FrameworkElement;
+ if (linkBtn.Tag == null)
+ {
+ return;
+ }
+
+ Uri linkUrl = new Uri(linkBtn.Tag as string, UriKind.Absolute);
+
+ WebBrowserTask webBrowserTask = new WebBrowserTask();
+ webBrowserTask.Uri = linkUrl;
+ webBrowserTask.Show();
+ }
+
+ #endregion
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs
index c7b511b2..68a90e99 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs
+++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs
@@ -294,6 +294,24 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die stud. Vereine ähnelt.
+ ///
+ public static string LinkApp_ClubLinks {
+ get {
+ return ResourceManager.GetString("LinkApp_ClubLinks", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die allg. Links ähnelt.
+ ///
+ public static string LinkApp_CommonLinks {
+ get {
+ return ResourceManager.GetString("LinkApp_CommonLinks", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die Links ähnelt.
///
diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx
index 4aa62828..eac8d920 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx
+++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx
@@ -287,4 +287,10 @@
Sonntag
+
+ stud. Vereine
+
+
+ allg. Links
+
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
index c4881720..d3783dd3 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.Designer.cs
@@ -60,6 +60,24 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die ClubLinks.xml ähnelt.
+ ///
+ internal static string FileLink_ClubLinks {
+ get {
+ return ResourceManager.GetString("FileLink_ClubLinks", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die CommonLinks.xml ähnelt.
+ ///
+ internal static string FileLink_CommonLinks {
+ get {
+ return ResourceManager.GetString("FileLink_CommonLinks", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die LectureModel ähnelt.
///
@@ -204,6 +222,15 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die /Pages/Links/LinkPage.xaml ähnelt.
+ ///
+ internal static string PathLinks_LinkPage {
+ get {
+ return ResourceManager.GetString("PathLinks_LinkPage", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Webmail/WebmailPage.xaml ähnelt.
///
@@ -258,6 +285,24 @@ namespace CampusAppWP8.Resources {
}
}
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=clubs&app=2&appversion=1 ähnelt.
+ ///
+ internal static string UrlLink_ClubLinks {
+ get {
+ return ResourceManager.GetString("UrlLink_ClubLinks", resourceCulture);
+ }
+ }
+
+ ///
+ /// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=links&app=2&appversion=1 ähnelt.
+ ///
+ internal static string UrlLink_CommonLinks {
+ get {
+ return ResourceManager.GetString("UrlLink_CommonLinks", resourceCulture);
+ }
+ }
+
///
/// Sucht eine lokalisierte Zeichenfolge, die https://webmail.tu-cottbus.de ähnelt.
///
diff --git a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
index 9011849e..1703b66c 100644
--- a/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
+++ b/CampusAppWP8/CampusAppWP8/Resources/Constants.resx
@@ -189,4 +189,19 @@
/Pages/Openinghours/OpeninghoursPage.xaml
+
+ ClubLinks.xml
+
+
+ CommonLinks.xml
+
+
+ http://www.tu-cottbus.de/campusapp-data/getdata.php?db=clubs&app=2&appversion=1
+
+
+ http://www.tu-cottbus.de/campusapp-data/getdata.php?db=links&app=2&appversion=1
+
+
+ /Pages/Links/LinkPage.xaml
+
\ No newline at end of file
diff --git a/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml b/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml
index 91009353..42b1c76a 100644
--- a/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/pages/StartPage.xaml
@@ -122,7 +122,7 @@
-