diff --git a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj index 6dd20d51..ab05e896 100644 --- a/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj +++ b/CampusAppWP8/CampusAppWP8/CampusAppWP8.csproj @@ -101,6 +101,12 @@ + + + + + + @@ -109,12 +115,16 @@ DepartmentPage.xaml - + + LecturePage.xaml + + Results.xaml + MensaPage.xaml @@ -165,7 +175,11 @@ Designer MSBuild:Compile - + + Designer + MSBuild:Compile + + Designer MSBuild:Compile diff --git a/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs b/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs index 200a646c..565266b7 100644 --- a/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs +++ b/CampusAppWP8/CampusAppWP8/Feed/Mensa/MensaFeed.cs @@ -27,15 +27,6 @@ namespace CampusAppWP8.Pages.Mensa { } - #endregion - - #region Proberty - - /// - /// Gets or sets i List of MenuModel - /// - public ObservableCollection Menus { get; set; } - #endregion #region Method diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs new file mode 100644 index 00000000..8bf99472 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureActivity.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace CampusAppWP8.Model.Lecture +{ + public class LectureActivity + { + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public LectureActivity() + { + } + + #endregion + + #region Proberty + + [XmlElement("art")] + public string Type{ get; set; } + + [XmlElement("semester")] + public int Semester { get; set; } + + [XmlElement("sws")] + public string SWS { get; set; } + + [XmlElement("modul")] + public LectureModul Modul { get; set; } + + [XmlElement("lehrperson")] + public ObservableCollection Lecturer { get; set; } + + [XmlElement("studiengang")] + public ObservableCollection Course { get; set; } + + [XmlElement("termin")] + public ObservableCollection Dates { get; set; } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureCourse.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureCourse.cs new file mode 100644 index 00000000..30018c7e --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureCourse.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Serialization; + +namespace CampusAppWP8.Model.Lecture +{ + public class LectureCourse + { + public LectureCourse() + { + } + [XmlElement("bezeichnung")] + public string Title {get;set;} + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureDate.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureDate.cs new file mode 100644 index 00000000..9e802558 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureDate.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Serialization; + +namespace CampusAppWP8.Model.Lecture +{ + public class LectureDate + { + public LectureDate() + { + } + + [XmlElement("wochentag")] + public string WeekDay { get; set; } + [XmlElement("von")] + public string From { get; set; } + [XmlElement("bis")] + public string To { get; set; } + [XmlElement("rhythmus")] + public string Interval { get; set; } + [XmlElement("raum")] + public string Room { get; set; } + [XmlElement("anfangsdatum")] + public string StarDate { get; set; } + [XmlElement("enddatum")] + public string EndDate { get; set; } + + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs new file mode 100644 index 00000000..04990c7f --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureLecturer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Serialization; + +namespace CampusAppWP8.Model.Lecture +{ + public class LectureLecturer + { + public LectureLecturer() + { + } + + [XmlElement("vorname")] + public string FirstName { get; set; } + + [XmlElement("name")] + public string LastName { get; set; } + + [XmlElement("titel")] + public string Title { get; set; } + + [XmlAttribute("zustaendigkeit")] + public string Responsibility { get; set; } + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs new file mode 100644 index 00000000..ac8e3fda --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureList.cs @@ -0,0 +1,36 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 10.06.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Model.Lecture +{ + using System.Collections.ObjectModel; + using System.Xml.Serialization; + [XmlRoot("lsf_auszug")] + public class LectureList + { + + #region Constructor + + /// + /// Initializes a new instance of the class. + /// + public LectureList() + { + } + + #endregion + + #region Proberty + + [XmlArray("veranstaltungsliste")] + [XmlArrayItem("veranstaltung")] + public ObservableCollection Activity { get; set; } + + #endregion + + } +} diff --git a/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModul.cs b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModul.cs new file mode 100644 index 00000000..febfec0f --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Model/Lecture/LectureModul.cs @@ -0,0 +1,69 @@ +//----------------------------------------------------------------------- +// +// Company copyright tag. +// +// stubbfel +// 10.06.2013 +//---------------------------------------------------------------------- +namespace CampusAppWP8.Model.Lecture +{ + using System; + using System.Xml.Serialization; + public class LectureModul + { + #region Members + + private int number; + + private Uri url; + + #endregion + + #region Constructor + + public LectureModul() + { + } + + #endregion + + #region Property + + [XmlElement("titel")] + public string Title {get; set;} + + [XmlElement("nummer")] + public int Number{ + get + { + return this.number; + } + set + { + if (value != this.number) + { + this.number = value; + this.createUrl(); + } + } + } + + public Uri Url{ + get + { + return url; + } + } + + #endregion + + #region Methods + + private void createUrl() + { + this.url = new Uri("https://www.tu-cottbus.de/modul/" + number.ToString()); + } + + #endregion + } +} diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs new file mode 100644 index 00000000..c09325cd --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LectureFeed.cs @@ -0,0 +1,37 @@ +using CampusAppWP8.Model.Lecture; +using CampusAppWP8.Utility; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CampusAppWP8.Pages.Lecture +{ + public class LectureFeed : XmlFeed + { + public LectureFeed() + : base(new Uri("http://www.zv.tu-cottbus.de/LSFveranst/LSF4?Semester=20112&Abschluss=82&Studiengang=079&Von=1&Bis=2"), "Lecture.xml") + { + this.validRootName = "lsf_auszug"; + } + + /// + /// Method implement CheckIsModelUpToDate()-Method + /// + /// true, if model is up-to-date, otherwise false + protected override bool CheckIsModelUpToDate() + { + return false; + } + + /// + /// Method implement CheckIsFileUpToDate()-Method + /// + /// true, if file is up-to-date, otherwise false + protected override bool CheckIsFileUpToDate() + { + return true; + } + } +} diff --git a/CampusAppWP8/CampusAppWP8/pages/lecture/LecturePage.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml similarity index 99% rename from CampusAppWP8/CampusAppWP8/pages/lecture/LecturePage.xaml rename to CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml index 155fb0e5..657782b2 100644 --- a/CampusAppWP8/CampusAppWP8/pages/lecture/LecturePage.xaml +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml @@ -100,7 +100,7 @@ - diff --git a/CampusAppWP8/CampusAppWP8/pages/lecture/LecturePage.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs similarity index 79% rename from CampusAppWP8/CampusAppWP8/pages/lecture/LecturePage.xaml.cs rename to CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs index 7fa67653..21f26d96 100644 --- a/CampusAppWP8/CampusAppWP8/pages/lecture/LecturePage.xaml.cs +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/LecturePage.xaml.cs @@ -7,6 +7,8 @@ using System.Windows.Controls; using System.Windows.Navigation; using Microsoft.Phone.Controls; using Microsoft.Phone.Shell; +using CampusAppWP8.Pages.Lecture; +using CampusAppWP8.Utility; namespace CampusAppWP8.Pages.lecture { @@ -15,6 +17,8 @@ namespace CampusAppWP8.Pages.lecture public Lecture() { InitializeComponent(); + LectureFeed test = new LectureFeed(); + test.LoadFeed(); } private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/Results.xaml b/CampusAppWP8/CampusAppWP8/Pages/Lecture/Results.xaml new file mode 100644 index 00000000..119c3071 --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/Results.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Pages/Lecture/Results.xaml.cs b/CampusAppWP8/CampusAppWP8/Pages/Lecture/Results.xaml.cs new file mode 100644 index 00000000..4897337f --- /dev/null +++ b/CampusAppWP8/CampusAppWP8/Pages/Lecture/Results.xaml.cs @@ -0,0 +1,20 @@ +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; + +namespace CampusAppWP8.Pages.Lecture +{ + public partial class Results : PhoneApplicationPage + { + public Results() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml index 04b6f0e8..b65e09d5 100644 --- a/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml +++ b/CampusAppWP8/CampusAppWP8/Properties/WMAppManifest.xml @@ -13,7 +13,7 @@ - + diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs index 211fb878..e5345b13 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.Designer.cs @@ -169,7 +169,7 @@ namespace CampusAppWP8.Resources { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Vorlesung ähnelt. + /// Sucht eine lokalisierte Zeichenfolge, die Vorlesungen ähnelt. /// public static string LectureApp_Title { get { diff --git a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx index db28a286..9ce3f841 100644 --- a/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx +++ b/CampusAppWP8/CampusAppWP8/Resources/AppResources.resx @@ -153,7 +153,7 @@ Hausaufgaben - Vorlesung + Vorlesungen Links diff --git a/CampusAppWP8/CampusAppWP8/Utility/RestApi.cs b/CampusAppWP8/CampusAppWP8/Utility/RestApi.cs index 49a94bbe..f179c448 100644 --- a/CampusAppWP8/CampusAppWP8/Utility/RestApi.cs +++ b/CampusAppWP8/CampusAppWP8/Utility/RestApi.cs @@ -8,16 +8,12 @@ namespace CampusAppWP8.Utility { using System; - using System.Collections.Generic; - using System.Linq; using System.Net; - using System.Text; - using System.Threading.Tasks; /// /// Class realize the access of restful RestAPI /// - public class RestApi + public abstract class RestApi { #region Members diff --git a/CampusAppWP8/CampusAppWP8/utility/XMLFeed.cs b/CampusAppWP8/CampusAppWP8/utility/XMLFeed.cs index 760d964d..5b49b20d 100644 --- a/CampusAppWP8/CampusAppWP8/utility/XMLFeed.cs +++ b/CampusAppWP8/CampusAppWP8/utility/XMLFeed.cs @@ -18,6 +18,8 @@ namespace CampusAppWP8.Utility /// Type for model of the feed public abstract class XmlFeed : Feed { + protected string validRootName = Constants.XMLRootElementName; + #region Constructor /// @@ -48,10 +50,9 @@ namespace CampusAppWP8.Utility { XmlSerializer serializer = new XmlSerializer(typeof(T)); XDocument document = XDocument.Parse(feedString); - string validRootName = Constants.XMLRootElementName; - if (!document.Root.Name.Equals(validRootName)) + if (!document.Root.Name.ToString().Equals(validRootName)) { - XElement content = document.Root; + XElement content = document.Root; document = new XDocument(); document.Add(new XElement(validRootName, content)); }