diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs
index 3da6312e..30a96096 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventIndexPage.xaml.cs
@@ -1,53 +1,66 @@
-using CampusAppWP8.Pages.Events;
-using CampusAppWP8.Model.events_news;
-using CampusAppWP8.Utility;
-using Microsoft.Phone.Controls;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Navigation;
-using CampusAppWP8.Feed.Events;
-
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// fiedlchr
+// 03.05.2013
+//-----------------------------------------------------------------------------
namespace CampusAppWP8.Pages.Events
{
+ using System;
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
+ using System.Linq;
+ using System.Windows;
+ using System.Windows.Controls;
+ using System.Windows.Navigation;
+ using CampusAppWP8.Feed.Events;
+ using CampusAppWP8.Model.events_news;
+ using CampusAppWP8.Utility;
+ using Microsoft.Phone.Controls;
+
///
/// Overview page of all events.
///
public partial class EventIndexPage : PhoneApplicationPage
{
///
- /// Event Feed object, which contains the rss models and data.
+ /// Gets or sets Event Feed object, which contains the RSS models and data.
///
public static EventFeed eventFeed { get; set; }
///
- /// Default constructor.
+ /// Initializes a new instance of the class.
///
public EventIndexPage()
{
- InitializeComponent();
+ this.InitializeComponent();
EventIndexPage.eventFeed = new EventFeed();
}
///
- /// On navigation to this page, creates a FeedEventHandler and load the rss feed data.
+ /// On navigation to this page, creates a FeedEventHandler and load the RSS feed data.
///
/// event args
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
- // Set handler and load the fees informations.
- EventIndexPage.eventFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(SetupEventPageList);
- EventIndexPage.eventFeed.LoadFeed();
+ if ((EventIndexPage.eventFeed.Model == null)
+ || (EventIndexPage.eventFeed.Model.Channel == null)
+ || (EventIndexPage.eventFeed.Model.Channel.Count() == 0)
+ || (EventIndexPage.eventFeed.Model.Channel[0].item == null)
+ || (EventIndexPage.eventFeed.Model.Channel[0].item.Count() == 0))
+ {
+ // Set handler and load the fees informations.
+ EventIndexPage.eventFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.SetupEventPageList);
+ EventIndexPage.eventFeed.LoadFeed();
+ }
}
///
- /// Is called after the rss feeds are loaded into the eventFeed model.
- /// If there was no feed informations set to the ui, the feed list
+ /// Is called after the RSS feeds are loaded into the eventFeed model.
+ /// If there was no feed information set to the UI, the feed list
/// will be sorted by timestamp and the buttons will be created.
///
private void SetupEventPageList()
@@ -71,7 +84,7 @@ namespace CampusAppWP8.Pages.Events
tempBtn.HorizontalContentAlignment = HorizontalAlignment.Stretch;
tempBtn.BorderThickness = new Thickness(0.0);
tempBtn.Padding = new Thickness(0.0);
- tempBtn.Click += EventRowAppButton_Click;
+ tempBtn.Click += this.EventRowAppButton_Click;
tempBtn.Tag = i;
this.ButtonPanel.Items.Add(tempBtn);
@@ -80,12 +93,11 @@ namespace CampusAppWP8.Pages.Events
}
///
- /// Return the eventFeed object.
+ /// Gets the eventFeed object.
///
- static public EventFeed GetEventFeed
+ public static EventFeed GetEventFeed
{
get { return EventIndexPage.eventFeed; }
- set { }
}
///
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml
index e5782082..a84c2441 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml
+++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml
@@ -37,7 +37,7 @@
-
+
diff --git a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs
index 1dd9c43f..0103c535 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/Events/EventPage.xaml.cs
@@ -1,16 +1,22 @@
-using Microsoft.Phone.Controls;
-using Microsoft.Phone.Tasks;
-using System;
-using System.Linq;
-using System.Windows;
-using System.Windows.Navigation;
-
-
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// fiedlchr
+// 03.05.2013
+//-----------------------------------------------------------------------------
namespace CampusAppWP8.Pages.Events
{
+ using System;
+ using System.Linq;
+ using System.Windows;
+ using System.Windows.Navigation;
+ using Microsoft.Phone.Controls;
+ using Microsoft.Phone.Tasks;
+
///
- /// EventPage, where every event fees has his own pivotitem.
+ /// EventPage, where every event fees has his own PivotItem.
///
public partial class EventPage : PhoneApplicationPage
{
@@ -20,19 +26,19 @@ namespace CampusAppWP8.Pages.Events
private bool isSourceSet = false;
///
- /// Default constructor.
+ /// Initializes a new instance of the class.
///
public EventPage()
{
- InitializeComponent();
+ this.InitializeComponent();
}
///
/// On navigation to this page.
- /// The pivotitem source will be set, if it wasn't befor.
- /// Navigating to the submited index of the choosen pivotitem page.
+ /// The PivotItem source will be set, if it wasn't before.
+ /// Navigating to the submitted index of the chosen PivotItem page.
///
- ///
+ /// Event Args
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
@@ -49,7 +55,7 @@ namespace CampusAppWP8.Pages.Events
}
}
- string pivotIndex = "";
+ string pivotIndex = string.Empty;
// Navigate to the selected pivotitem
if (NavigationContext.QueryString.TryGetValue("pivotindex", out pivotIndex))
@@ -57,12 +63,15 @@ namespace CampusAppWP8.Pages.Events
int pivotIndexInt = int.Parse(pivotIndex);
// if the index is in the range of the array
- if((pivotIndexInt >= 0) && (pivotIndexInt < EventIndexPage.GetEventFeed.Model.Channel[0].item.Count()))
+ if ((pivotIndexInt >= 0) && (pivotIndexInt < EventIndexPage.GetEventFeed.Model.Channel[0].item.Count()))
+ {
EventPivot.SelectedIndex = pivotIndexInt;
+ }
else
+ {
MessageBox.Show("ERROR: pivotIndex out of range!!!");
+ }
}
-
}
///
@@ -80,7 +89,7 @@ namespace CampusAppWP8.Pages.Events
///
/// On clicking the link button if a link exists in the feed
/// (lower right).
- /// Open the webbrowser with the url set in the feed.
+ /// Open the WebBrowser with the url set in the feed.
///
/// clicked button
/// event args
diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs
index 69215c09..70089eef 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsIndexPage.xaml.cs
@@ -1,57 +1,66 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Navigation;
-using Microsoft.Phone.Controls;
-using Microsoft.Phone.Shell;
-
-using CampusAppWP8.Model.events_news;
-using CampusAppWP8.Utility;
-using CampusAppWP8.Resources;
-using System.Collections.ObjectModel;
-using CampusAppWP8.Pages.News;
-using CampusAppWP8.Feed.News;
-
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// fiedlchr
+// 03.05.2013
+//-----------------------------------------------------------------------------
namespace CampusAppWP8.Pages.News
{
+ using System;
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
+ using System.Linq;
+ using System.Windows;
+ using System.Windows.Controls;
+ using System.Windows.Navigation;
+ using CampusAppWP8.Feed.News;
+ using CampusAppWP8.Model.events_news;
+ using CampusAppWP8.Utility;
+ using Microsoft.Phone.Controls;
+
///
/// Overview page of all news.
///
public partial class NewsIndexPage : PhoneApplicationPage
{
///
- /// News Feed object, which contains the rss models and data.
+ /// Gets or sets News Feed object, which contains the RSS models and data.
///
public static NewsFeed newsFeed { get; set; }
///
- /// Default constructor.
+ /// Initializes a new instance of the class.
///
public NewsIndexPage()
{
- InitializeComponent();
+ this.InitializeComponent();
NewsIndexPage.newsFeed = new NewsFeed();
}
///
- /// On navigation to this page, creates a FeedEventHandler and load the rss feed data.
+ /// On navigation to this page, creates a FeedEventHandler and load the RSS feed data.
///
/// event args
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
- // Set handler and load the fees informations.
- NewsIndexPage.newsFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(SetupNewsPageList);
- NewsIndexPage.newsFeed.LoadFeed();
+ if ((NewsIndexPage.newsFeed.Model == null)
+ || (NewsIndexPage.newsFeed.Model.Channel == null)
+ || (NewsIndexPage.newsFeed.Model.Channel.Count() == 0)
+ || (NewsIndexPage.newsFeed.Model.Channel[0].item == null)
+ || (NewsIndexPage.newsFeed.Model.Channel[0].item.Count() == 0))
+ {
+ // Set handler and load the fees informations.
+ NewsIndexPage.newsFeed.EventHandler.FeedIsReadyEvent += new FeedEventHandler.FeedReadyHandler(this.SetupNewsPageList);
+ NewsIndexPage.newsFeed.LoadFeed();
+ }
}
///
- /// Is called after the rss feeds are loaded into the newsFeed model.
- /// If there was no feed informations set to the ui, the feed list
+ /// Is called after the RSS feeds are loaded into the newsFeed model.
+ /// If there was no feed information set to the UI, the feed list
/// will be sorted by timestamp and the buttons will be created.
///
private void SetupNewsPageList()
@@ -75,7 +84,7 @@ namespace CampusAppWP8.Pages.News
tempBtn.HorizontalContentAlignment = HorizontalAlignment.Stretch;
tempBtn.BorderThickness = new Thickness(0.0);
tempBtn.Padding = new Thickness(0.0);
- tempBtn.Click += NewsRowAppButton_Click;
+ tempBtn.Click += this.NewsRowAppButton_Click;
tempBtn.Tag = i;
this.ButtonPanel.Items.Add(tempBtn);
@@ -84,12 +93,11 @@ namespace CampusAppWP8.Pages.News
}
///
- /// Return the newsFeed object.
+ /// Gets the newsFeed object.
///
- static public NewsFeed GetNewsFeed
+ public static NewsFeed GetNewsFeed
{
get { return NewsIndexPage.newsFeed; }
- set { }
}
///
diff --git a/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml.cs
index cd7a1dfa..228678d3 100644
--- a/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml.cs
+++ b/CampusAppWP8/CampusAppWP8/Pages/News/NewsPage.xaml.cs
@@ -1,27 +1,22 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Navigation;
-using Microsoft.Phone.Controls;
-using Microsoft.Phone.Shell;
-using System.Xml.Linq;
-using System.Xml;
-using System.IO;
-using Microsoft.Phone.Tasks;
-
-using CampusAppWP8.Model.events_news;
-using CampusAppWP8.Utility;
-using CampusAppWP8.Resources;
-
-
+//-----------------------------------------------------------------------------
+//
+// Company copyright tag.
+//
+// fiedlchr
+// 03.05.2013
+//-----------------------------------------------------------------------------
namespace CampusAppWP8.Pages.News
{
+ using System;
+ using System.Linq;
+ using System.Windows;
+ using System.Windows.Navigation;
+ using Microsoft.Phone.Controls;
+ using Microsoft.Phone.Tasks;
+
///
- /// EventPage, where every news fees has his own pivotitem.
+ /// EventPage, where every news fees has his own PivotItem.
///
public partial class NewsPage : PhoneApplicationPage
{
@@ -31,36 +26,37 @@ namespace CampusAppWP8.Pages.News
private bool isSourceSet = false;
///
- /// Default constructor.
+ /// Initializes a new instance of the class.
///
public NewsPage()
{
- InitializeComponent();
+ this.InitializeComponent();
}
///
/// On navigation to this page.
- /// The pivotitem source will be set, if it wasn't befor.
- /// Navigating to the submited index of the choosen pivotitem page.
+ /// The PivotItem source will be set, if it wasn't before.
+ /// Navigating to the submitted index of the chosen PivotItem page.
///
- ///
+ /// Event Args
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
-
+
// Set pivotitem Source
if (this.isSourceSet == false)
{
if ((NewsIndexPage.GetNewsFeed.Model != null)
&& (NewsIndexPage.GetNewsFeed.Model.Channel != null)
- && (NewsIndexPage.GetNewsFeed.Model.Channel.Count() >= 1))
+ && (NewsIndexPage.GetNewsFeed.Model.Channel.Count() >= 1)
+ && (this.NewsPivot.Items.Count() == 0))
{
this.NewsPivot.ItemsSource = NewsIndexPage.GetNewsFeed.Model.Channel[0].item;
this.isSourceSet = true;
}
}
- string pivotIndex = "";
+ string pivotIndex = string.Empty;
// Navigate to the selected pivotitem
if (NavigationContext.QueryString.TryGetValue("pivotindex", out pivotIndex))
@@ -69,11 +65,14 @@ namespace CampusAppWP8.Pages.News
// if the index is in the range of the array
if ((pivotIndexInt >= 0) && (pivotIndexInt < NewsIndexPage.GetNewsFeed.Model.Channel[0].item.Count()))
+ {
NewsPivot.SelectedIndex = pivotIndexInt;
+ }
else
+ {
MessageBox.Show("ERROR: pivotIndex out of range!!!");
+ }
}
-
}
///
@@ -91,7 +90,7 @@ namespace CampusAppWP8.Pages.News
///
/// On clicking the link button if a link exists in the feed
/// (lower right).
- /// Open the webbrowser with the url set in the feed.
+ /// Open the WebBrowser with the url set in the feed.
///
/// clicked button
/// event args