Merge branch 'feature/#211' into develop

This commit is contained in:
stubbfel
2013-10-02 13:28:07 +02:00
109 changed files with 2069 additions and 1306 deletions

View File

@@ -8,6 +8,7 @@
namespace CampusAppDLL.Model.Campusmap
{
using CampusAppDLL.Model.GeoDb;
using CampusAppDLL.Utility;
using System;
/// <summary>
@@ -41,6 +42,8 @@ namespace CampusAppDLL.Model.Campusmap
/// <remarks>Stubbfel, 19.08.2013.</remarks>
protected virtual void LoadSpatials(string xmlFilePath)
{
SpsModel model = XmlManager.DeserializationFileToModel<SpsModel>(xmlFilePath);
this.Spatial = model;
}
#endregion

View File

@@ -56,14 +56,14 @@ namespace CampusAppWP8.Api.GeoApi
/// Method return the campus of the placeList
/// </summary>
/// <returns>actual campus</returns>
public CampusAppWP8.Model.Setting.UserProfilModel.Campus GetCampus()
public CampusAppWPortalLib8.Model.Settings.Campus GetCampus()
{
if (this.Model == null)
{
return Settings.UserProfil.DefaultCampus;
}
CampusAppWP8.Model.Setting.UserProfilModel.Campus campus;
CampusAppWPortalLib8.Model.Settings.Campus campus;
foreach (PlaceModel place in this.Model.Places)
{
if (Enum.TryParse(place.PlaceId, true, out campus))

View File

@@ -11,9 +11,9 @@ namespace CampusAppWP8.Api.GeoApi
using System.Collections.Generic;
using CampusAppWP8.Model;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model.Utility;
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>Pis api.</summary>
/// <remarks>Stubbfel, 09.09.2013.</remarks>

View File

@@ -11,8 +11,8 @@ namespace CampusAppWP8.Api.GeoApi
using System.Collections.Generic;
using CampusAppWP8.Model;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>Pss api.</summary>

View File

@@ -7,13 +7,13 @@
//----------------------------------------------------------------------
namespace CampusAppWP8.Api.GeoApi
{
using System.Collections.Generic;
using System.Collections.Generic;
using CampusAppWP8.Model;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model.Utility;
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>
/// Class for SPSAPI

View File

@@ -10,6 +10,7 @@ namespace CampusAppWP8.Api.Lecture
using CampusAppWP8.Model;
using CampusAppWP8.Model.Lecture;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model;
/// <summary>
/// Class for the feed of the Lecture
@@ -17,7 +18,7 @@ namespace CampusAppWP8.Api.Lecture
/// <remarks>
/// need the XmlAPI
/// </remarks>
public class LectureApi : XmlModel<LectureList>
public class LectureApi : XmlModel<LectureWp8List>
{
#region Constructor

View File

@@ -11,10 +11,11 @@ namespace CampusAppWP8.Api.Person
using CampusAppWP8.Model;
using CampusAppWP8.Model.Person;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model;
/// <summary>Person search api.</summary>
/// <remarks>Stubbfel, 05.09.2013.</remarks>
public class PersonSearchApi : XmlModel<PersonListModel>
public class PersonSearchApi : XmlModel<PersonListWp8Model>
{
#region Constructor

View File

@@ -97,6 +97,7 @@
<Compile Include="Api\GeoApi\PisApi.cs" />
<Compile Include="Api\GeoApi\PssApi.cs" />
<Compile Include="Api\GeoApi\SpsApi.cs" />
<Compile Include="Api\Lecture\LectureApi.cs" />
<Compile Include="Api\Person\PersonSearchApi.cs" />
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
@@ -119,23 +120,20 @@
<Compile Include="Model\Campusmap\HiddenPinPlaceModel.cs" />
<Compile Include="Model\Campusmap\InfoPlacePinModel.cs" />
<Compile Include="Model\Campusmap\SearchPlacePinModel.cs" />
<Compile Include="Model\Exams\ExamListModel.cs" />
<Compile Include="Model\Exams\ExamModel.cs" />
<Compile Include="Model\Exams\ExamListWp8Model.cs" />
<Compile Include="Model\Exams\ExamWp8Model.cs" />
<Compile Include="Model\GeoDb\CampusBuildingLayerModel.cs" />
<Compile Include="Model\GeoDb\CampusBuildingModel.cs" />
<Compile Include="Model\GeoDb\PlaceInformation.cs" />
<Compile Include="Model\GeoDb\PlaceModel.cs" />
<Compile Include="Model\GeoDb\PlaceService.cs" />
<Compile Include="Model\GeoDb\SpsModel.cs" />
<Compile Include="Model\Person\PersonFunctionModel.cs" />
<Compile Include="Model\Person\PersonListModel.cs" />
<Compile Include="Model\Person\PersonModel.cs" />
<Compile Include="Model\Person\PersonFunctionWp8Model.cs" />
<Compile Include="Model\Person\PersonListWp8Model.cs" />
<Compile Include="Model\Person\PersonWp8Model.cs" />
<Compile Include="Model\Setting\AppSettings.cs" />
<Compile Include="Model\Setting\UserProfilModel.cs" />
<Compile Include="Model\Utility\CourseListPickerItemListModel.cs" />
<Compile Include="Model\Utility\CourseModel.cs" />
<Compile Include="Model\Utility\DegreeListPickerItemListModel.cs" />
<Compile Include="Model\Utility\CampusListPickerItemListModel.cs" />
<Compile Include="Model\Utility\CourseListPickerItemListWp8Model.cs" />
<Compile Include="Pages\Campusmap\RoomListPage.xaml.cs">
<DependentUpon>RoomListPage.xaml</DependentUpon>
</Compile>
@@ -163,9 +161,6 @@
<Compile Include="Utility\NDEF\NDEFMessage.cs" />
<Compile Include="Utility\NDEF\NDEFRecord.cs" />
<Compile Include="Utility\NDEF\NDEFShortRecord.cs" />
<Compile Include="Model\Utility\RoleListPickerItemListModel.cs" />
<Compile Include="Model\Utility\SemesterListPickerItemListModel.cs" />
<Compile Include="Model\Utility\ListPickerItemListModel.cs" />
<Compile Include="Pages\Dev\NFC.xaml.cs">
<DependentUpon>NFC.xaml</DependentUpon>
</Compile>
@@ -189,28 +184,16 @@
<Compile Include="LocalizedStrings.cs" />
<Compile Include="Model\Campusmap\MapModel.cs" />
<Compile Include="Model\Campusmap\MapPinModel.cs" />
<Compile Include="Model\Departments\ChairModel.cs" />
<Compile Include="Model\Departments\DepartmentModel.cs" />
<Compile Include="Model\Departments\FacultyModel.cs" />
<Compile Include="Model\Lecture\LectureActivity.cs" />
<Compile Include="Model\Lecture\LectureCourse.cs" />
<Compile Include="Model\Lecture\LectureDate.cs" />
<Compile Include="Model\Lecture\LectureLecturer.cs" />
<Compile Include="Model\Lecture\LectureList.cs" />
<Compile Include="Model\Lecture\LectureModule.cs" />
<Compile Include="Model\Lecture\LectureWp8Activity.cs" />
<Compile Include="Model\Lecture\LectureWp8List.cs" />
<Compile Include="Model\Lecture\LecturePageModel.cs" />
<Compile Include="Model\MainModel.cs" />
<Compile Include="Model\Link\LinkModel.cs" />
<Compile Include="Model\Link\LinkListModel.cs" />
<Compile Include="Model\Openinghours\OpeninghoursInstitutionModel.cs" />
<Compile Include="Model\Openinghours\OpeninghoursModel.cs" />
<Compile Include="Model\StudentCouncil\StudentCouncilListModel.cs" />
<Compile Include="Model\StudentCouncil\StudentCouncilModel.cs" />
<Compile Include="Model\Openinghours\OpeninghoursInstitutionWp8Model.cs" />
<Compile Include="Model\Openinghours\OpeninghoursWp8Model.cs" />
<Compile Include="Model\XmlModel.cs" />
<Compile Include="Pages\Campusmap\CampusMapPage.xaml.cs">
<DependentUpon>CampusMapPage.xaml</DependentUpon>
</Compile>
<Compile Include="Api\Lecture\LectureApi.cs" />
<Compile Include="Feed\Departments\DepartmentFeed.cs" />
<Compile Include="Pages\Departments\DepartmentFavoritePage.xaml.cs">
<DependentUpon>DepartmentFavoritePage.xaml</DependentUpon>
@@ -238,7 +221,6 @@
<Compile Include="Pages\Lecture\ModulWebPage.xaml.cs">
<DependentUpon>ModulWebPage.xaml</DependentUpon>
</Compile>
<Compile Include="Model\Utility\ListPickerItemModel.cs" />
<Compile Include="Pages\Lecture\ResultDetailPage.xaml.cs">
<DependentUpon>ResultDetailPage.xaml</DependentUpon>
</Compile>

View File

@@ -10,9 +10,10 @@ namespace CampusAppWP8.Feed.Departments
using System;
using System.IO;
using CampusAppWP8.Model;
using CampusAppWP8.Model.Departments;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Model.Departments;
/// <summary>
/// Feed class for the department information.

View File

@@ -13,6 +13,7 @@ namespace CampusAppWP8.Feed.Events
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model.RSS;
using CampusAppWPortalLib8.Model;
/// <summary>
/// Event Feed.

View File

@@ -12,10 +12,11 @@ namespace CampusAppWP8.Feed.Exams
using CampusAppWP8.Model.Exams;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>Exam feed.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
public class ExamFeed : XmlModel<ExamListModel>
public class ExamFeed : XmlModel<ExamListWp8Model>
{
#region Constructor
@@ -38,7 +39,7 @@ namespace CampusAppWP8.Feed.Exams
/// <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(ExamListModel model)
private bool CheckIsModelUpToDate(ExamListWp8Model model)
{
if (model == null)
{
@@ -53,7 +54,7 @@ namespace CampusAppWP8.Feed.Exams
/// <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(ExamListModel model, FileInfo fileInfo)
private bool CheckIsFileUpToDate(ExamListWp8Model model, FileInfo fileInfo)
{
if (fileInfo == null || !fileInfo.Exists || fileInfo.Length < 1)
{

View File

@@ -10,9 +10,10 @@ namespace CampusAppWP8.Feed.Link
using System;
using System.IO;
using CampusAppWP8.Model;
using CampusAppWP8.Model.Link;
using CampusAppWPortalLib8.Model.Link;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for ClubLinkFeeds

View File

@@ -10,9 +10,10 @@ namespace CampusAppWP8.Feed.Link
using System;
using System.IO;
using CampusAppWP8.Model;
using CampusAppWP8.Model.Link;
using CampusAppWPortalLib8.Model.Link;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for CommonLinkFeeds

View File

@@ -11,6 +11,7 @@ namespace CampusAppWP8.Feed.Mensa
using System.IO;
using CampusAppWP8.Model;
using CampusAppWPortalLib8.Model.Mensa;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for MensaFeeds
@@ -51,17 +52,17 @@ namespace CampusAppWP8.Feed.Mensa
/// </summary>
/// <param name="campus"> camus parameter </param>
/// <returns> the correct mensaFeed</returns>
public static MensaFeed CreateCampusMensaFeed(CampusAppWP8.Model.Setting.UserProfilModel.Campus campus)
public static MensaFeed CreateCampusMensaFeed(CampusAppWPortalLib8.Model.Settings.Campus campus)
{
switch (campus)
{
case CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_MAIN:
case CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN:
return new MensaFeedCBMain();
case CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_NORTH:
case CampusAppWPortalLib8.Model.Settings.Campus.CB_NORTH:
return new MensaFeedCBNorth();
case CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_SOUTH:
case CampusAppWPortalLib8.Model.Settings.Campus.CB_SOUTH:
return new MensaFeedCBSouth();
case CampusAppWP8.Model.Setting.UserProfilModel.Campus.SFB_MAIN:
case CampusAppWPortalLib8.Model.Settings.Campus.SFB_MAIN:
return new MensaFeedSBFMain();
default:
return new MensaFeedCBMain();

View File

@@ -22,7 +22,7 @@ namespace CampusAppWP8.Feed.Mensa
public MensaFeedCBMain()
: base(Constants.FileMensa_Shedule_CBMain, CampusAppWPortalLib8.Resources.Constants.UrlMensa_Week_CBMain)
{
this.Title = AppResources.Campus_CBMain;
this.Title = CampusAppWPortalLib8.Resources.AppResources.Campus_CBMain;
}
#endregion

View File

@@ -22,7 +22,7 @@ namespace CampusAppWP8.Feed.Mensa
public MensaFeedCBNorth()
: base(Constants.FileMensa_Shedule_CBNorth, CampusAppWPortalLib8.Resources.Constants.UrlMensa_Week_CBNorth)
{
this.Title = AppResources.Campus_CBNorth;
this.Title = CampusAppWPortalLib8.Resources.AppResources.Campus_CBNorth;
}
#endregion

View File

@@ -22,7 +22,7 @@ namespace CampusAppWP8.Feed.Mensa
public MensaFeedCBSouth()
: base(Constants.FileMensa_Shedule_CBSouth, CampusAppWPortalLib8.Resources.Constants.UrlMensa_Week_CBSouth)
{
this.Title = AppResources.Campus_CBSouth;
this.Title = CampusAppWPortalLib8.Resources.AppResources.Campus_CBSouth;
}
#endregion

View File

@@ -22,7 +22,7 @@ namespace CampusAppWP8.Feed.Mensa
public MensaFeedSBFMain()
: base(Constants.FileMensa_Shedule_SBFMain, CampusAppWPortalLib8.Resources.Constants.UrlMensa_Week_SBFMain)
{
this.Title = AppResources.Campus_SFBMain;
this.Title = CampusAppWPortalLib8.Resources.AppResources.Campus_SFBMain;
}
#endregion

View File

@@ -13,6 +13,7 @@ namespace CampusAppWP8.Feed.News
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model.RSS;
using CampusAppWPortalLib8.Model;
/// <summary>
/// News Feed.

View File

@@ -13,11 +13,12 @@ namespace CampusAppWP8.Feed.Openinghours
using CampusAppWP8.Model.Openinghours;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for MesaFeeds
/// </summary>
public class OpeninghoursFeed : XmlModel<OpeninghoursModel>
public class OpeninghoursFeed : XmlModel<OpeninghoursWp8Model>
{
#region Constructor
@@ -41,7 +42,7 @@ namespace CampusAppWP8.Feed.Openinghours
/// </summary>
/// <param name="model">reference of the FeedModel</param>
/// <returns>true, if model is up-to-date, otherwise false</returns>
private bool CheckIsModelUpToDate(OpeninghoursModel model)
private bool CheckIsModelUpToDate(OpeninghoursWp8Model model)
{
bool retValue = true;
@@ -63,7 +64,7 @@ namespace CampusAppWP8.Feed.Openinghours
/// <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(OpeninghoursModel model, FileInfo info)
private bool CheckIsFileUpToDateOnLoad(OpeninghoursWp8Model model, FileInfo info)
{
bool retValue = true;
@@ -84,7 +85,7 @@ namespace CampusAppWP8.Feed.Openinghours
/// <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(OpeninghoursModel model, FileInfo info)
private bool CheckIsFileUpToDateOnSave(OpeninghoursWp8Model model, FileInfo info)
{
bool retValue = true;

View File

@@ -10,9 +10,10 @@ namespace CampusAppWP8.Feed.StudentCouncil
using System;
using System.IO;
using CampusAppWP8.Model;
using CampusAppWP8.Model.StudentCouncil;
using CampusAppWPortalLib8.Model.StudentCouncil;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// This Class is for StudentCouncilFeed

View File

@@ -9,8 +9,9 @@ namespace CampusAppWP8.File.Departments
{
using System.IO;
using CampusAppWP8.Model;
using CampusAppWP8.Model.Departments;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Model.Departments;
/// <summary>
/// Feed object to handle favorite department feeds.

View File

@@ -30,7 +30,7 @@ namespace CampusAppWP8.File.Exams
/// <param name="fileName">Filename of the file.</param>
/// <param name="url"> URL of the document.</param>
public ExamFile(string fileName, string url)
: base(ModelType.FileAndFeed, fileName, url)
: base(CampusAppWPortalLib8.Model.ModelType.FileAndFeed, fileName, url)
{
this.IsFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDate);
this.IsModelUpToDateOnLoad += new IsModelUpToDate(this.CheckIsModelUpToDate);
@@ -50,7 +50,7 @@ namespace CampusAppWP8.File.Exams
{
if (this.storageFile == null)
{
this.storageFile = await this.file.AsStorageFile();
this.storageFile = await this.File.AsStorageFile();
}
if (this.storageFile != null)
@@ -66,7 +66,7 @@ namespace CampusAppWP8.File.Exams
/// <remarks>Stubbfel, 03.09.2013.</remarks>
public void SaveAndLaunchFile()
{
if (this.file.Exist())
if (this.File.Exist())
{
this.LaunchFile();
}

View File

@@ -22,7 +22,7 @@ namespace CampusAppWP8.File.Places
/// <summary>Initializes a new instance of the PlacesFile class.</summary>
/// <remarks>Stubbfel, 09.09.2013.</remarks>
public PlacesFile()
: base(ModelType.File, Constants.FilePlace_AllPlaces)
: base(CampusAppWPortalLib8.Model.ModelType.File, Constants.FilePlace_AllPlaces)
{
this.OnFailedFile += new OnFailed(this.FallBackLoad);
this.IsFileUpToDateOnLoad += new IsFileUpToDate(this.CheckIsFileUpToDate);

View File

@@ -8,6 +8,8 @@
namespace CampusAppWP8.Model
{
using CampusAppWPortalLib8.Model;
/// <summary>Binary model.</summary>
/// <remarks>Stubbfel, 03.09.2013.</remarks>
public abstract class BinaryModel : MainModel<byte[]>

View File

@@ -21,7 +21,7 @@ namespace CampusAppWP8.Model.Campusmap
#region Member
/// <summary>Variable for the identify of the campus.</summary>
private static readonly string Campus = ((int)CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_MAIN).ToString();
private static readonly string Campus = ((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN).ToString();
#endregion

View File

@@ -0,0 +1,18 @@
//-----------------------------------------------------------------------
// <copyright file="ExamListWp8Model.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>02.09.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Exams
{
using System.Xml.Serialization;
/// <summary>Exam list model.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
[XmlRoot("links")]
public class ExamListWp8Model : CampusAppWPortalLib8.Model.Exams.ExamListModel<ExamWp8Model>
{
}
}

View File

@@ -0,0 +1,30 @@
//-----------------------------------------------------------------------
// <copyright file="ExamWp8Model.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>02.09.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Exams
{
using CampusAppWP8.Utility;
/// <summary>Exam model.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
public class ExamWp8Model : CampusAppWPortalLib8.Model.Exams.ExamModel
{
#region Property
/// <summary>Gets the caption.</summary>
/// <value>The caption.</value>
public string Caption
{
get
{
return Wp8StringManager.StripAndDecodeHTML(this.CourseText + " (" + this.Type + "/" + this.Version + ")");
}
}
#endregion
}
}

View File

@@ -10,6 +10,7 @@ namespace CampusAppWP8.Model.Lecture
using System.Runtime.Serialization;
using CampusAppWP8.Model.Setting;
using CampusAppWP8.Model.Utility;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>
/// Model for the LecturePage
@@ -55,7 +56,7 @@ namespace CampusAppWP8.Model.Lecture
/// <remarks>
/// need to be extend to full list
/// </remarks>
private CourseListPickerItemListModel courseList;
private CourseListPickerItemListWp8Model courseList;
/// <summary>
/// List of the degrees
@@ -265,8 +266,8 @@ namespace CampusAppWP8.Model.Lecture
/// </summary>
public void LoadLists()
{
this.courseList = new CourseListPickerItemListModel();
this.courseList.OnLoaded += new CourseListPickerItemListModel.OnIO(this.CourseListIsReady);
this.courseList = new CourseListPickerItemListWp8Model();
this.courseList.OnLoaded += new CourseListPickerItemListWp8Model.OnIO(this.CourseListIsReady);
this.courseList.LoadCourseList();
}

View File

@@ -0,0 +1,79 @@
//-----------------------------------------------------------------------
// <copyright file="LectureWp8Activity.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>13.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
{
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model.Lecture;
/// <summary>
/// Model for a Activity
/// </summary>
public class LectureWp8Activity : LectureActivity
{
#region Members
/// <summary>URL of the icon.</summary>
private string iconUrl;
#endregion
#region Proberty
/// <summary>Gets URL of the icon.</summary>
/// <value>The icon URL.</value>
public string IconUrl
{
get
{
this.CreateIconUrl();
return this.iconUrl;
}
}
#endregion
#region Methods
#region private
/// <summary>Creates icon URL.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
private void CreateIconUrl()
{
string typeStr = this.Type;
if (typeStr.Contains(CampusAppWPortalLib8.Model.Lecture.LectureActivity.ActivityTypeLecture))
{
this.iconUrl = Icons.Lecture;
}
else if (typeStr.Contains(CampusAppWPortalLib8.Model.Lecture.LectureActivity.ActivityTypeExam))
{
this.iconUrl = Icons.Exams;
}
else if (typeStr.Contains(CampusAppWPortalLib8.Model.Lecture.LectureActivity.ActivityTypePract))
{
this.iconUrl = Icons.Practise;
}
else if (typeStr.Contains(CampusAppWPortalLib8.Model.Lecture.LectureActivity.ActivityTypeSeminar))
{
this.iconUrl = Icons.Seminar;
}
else if (typeStr.Contains(CampusAppWPortalLib8.Model.Lecture.LectureActivity.ActivityTypeLab))
{
this.iconUrl = Icons.Lab;
}
else
{
this.iconUrl = Icons.Info;
}
}
#endregion
#endregion
}
}

View File

@@ -0,0 +1,34 @@
//-----------------------------------------------------------------------
// <copyright file="LectureWp8List.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>10.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
{
using System.Linq;
using System.Xml.Serialization;
/// <summary>
/// Model for a List of LectureActivity
/// </summary>
[XmlRoot("lsf_auszug")]
public class LectureWp8List : CampusAppWPortalLib8.Model.Lecture.LectureList<LectureWp8Activity>
{
#region Methods
/// <summary>
/// Method return a certain activity
/// </summary>
/// <param name="id"> id of the activity</param>
/// <returns> the activity (FirstOrDefault)</returns>
public new LectureWp8Activity GetActivity(int id)
{
LectureWp8Activity activity = this.Activities.Where(p => p.Id == id).FirstOrDefault();
return base.GetActivity(id) as LectureWp8Activity;
}
#endregion
}
}

View File

@@ -5,60 +5,20 @@
// <author>fiedlchr</author>
// <sience>05.07.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8
namespace CampusAppWP8.Model
{
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model.Utility;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// Base model io handling class.
/// </summary>
/// <typeparam name="T">model type</typeparam>
public abstract class MainModel<T>
public abstract class MainModel<T> : AbstractMainModel<T>
{
#region Member
/// <summary>
/// File object.
/// </summary>
protected CampusAppWP8.Utility.File file = null;
/// <summary>
/// Model io type.
/// </summary>
private ModelType modelType;
/// <summary>
/// Model object.
/// </summary>
private T model = default(T);
/// <summary>
/// Web object.
/// </summary>
private HttpRequest api = null;
/// <summary>
/// Filename of saved data.
/// </summary>
private string fileName = string.Empty;
/// <summary>
/// Url of the feed data.
/// </summary>
private Uri httpApiUri = null;
/// <summary>
/// Parameterized uri of the feed.
/// </summary>
private Uri paramizedUri = null;
#endregion
#region Constructor
/// <summary>
@@ -68,8 +28,8 @@ namespace CampusAppWP8
/// <param name="fileName">name of the file</param>
/// <param name="url">url of the feed</param>
public MainModel(ModelType modelType, string fileName, string url)
: base(modelType, fileName, url)
{
this.Init(modelType, fileName, url);
}
/// <summary>
@@ -78,42 +38,14 @@ namespace CampusAppWP8
/// <param name="modelType">Model IO type</param>
/// <param name="sourceName">name of the file or the url of the feed</param>
public MainModel(ModelType modelType, string sourceName)
: base(modelType, sourceName)
{
if (modelType == ModelType.File)
{
this.Init(modelType, sourceName, string.Empty);
}
else if (modelType == ModelType.Feed)
{
this.Init(modelType, string.Empty, sourceName);
}
else
{
throw new NotSupportedException("Wrong constructor was called for Feed and File support.");
}
}
#endregion
#region Events
/// <summary>
/// Delegate of the OnIO callback function.
/// </summary>
public delegate void OnIO();
/// <summary>
/// Delegate of the OnFailed(File/Web) callback function.
/// </summary>
public delegate void OnFailed();
/// <summary>
/// Delegate of the IsModelUpToDate callback function.
/// </summary>
/// <param name="model">data model</param>
/// <returns>true, model is up to date</returns>
public delegate bool IsModelUpToDate(T model);
/// <summary>
/// Delegate of the IsFileUpToDate callback function.
/// </summary>
@@ -122,47 +54,6 @@ namespace CampusAppWP8
/// <returns>true, is file is up to date</returns>
public delegate bool IsFileUpToDate(T model, FileInfo fileInfo);
/// <summary>
/// Callback pointer, called before loading.
/// </summary>
public event OnIO OnLoading = null;
/// <summary>
/// Callback pointer, called after loading.
/// </summary>
public event OnIO OnLoaded = null;
/// <summary>
/// Callback pointer, called before saving.
/// </summary>
public event OnIO OnSaving = null;
/// <summary>
/// Callback pointer, called after saving.
/// </summary>
public event OnIO OnSaved = null;
/// <summary>
/// Callback pointer, called after failed file loading.
/// </summary>
public event OnFailed OnFailedFile = null;
/// <summary>
/// Callback pointer, called after failed web loading.
/// </summary>
public event OnFailed OnFailedWeb = null;
/// <summary>
/// Callback pointer, called after failed file or web loading, if there
/// is no specialized onFailed callback set.
/// </summary>
public event OnFailed OnFailedLoad = null;
/// <summary>
/// Callback pointer, called after failed saving data to file.
/// </summary>
public event OnFailed OnFailedSave = null;
/// <summary>
/// Callback pointer, for checking if file is up to date at loading.
/// </summary>
@@ -173,314 +64,123 @@ namespace CampusAppWP8
/// </summary>
public event IsFileUpToDate IsFileUpToDateOnSave = null;
/// <summary>
/// Callback pointer, for checking if model is up to date at loading.
/// </summary>
public event IsModelUpToDate IsModelUpToDateOnLoad = null;
/// <summary>
/// Callback pointer, for checking if model is up to date at saving.
/// (currently unused)
/// </summary>
public event IsModelUpToDate IsModelUpToDateOnSave = null;
#endregion
#region Enum
#region property
/// <summary>
/// Specifies the I/O type of the model.
/// Gets or sets the file
/// </summary>
public enum ModelType
{
/// <summary>
/// Invalid/unset state.
/// </summary>
INVALID = 0,
/// <summary>
/// File only (01).
/// </summary>
File = 1,
/// <summary>
/// Feed only (10).
/// </summary>
Feed = 2,
/// <summary>
/// File and feed (11).
/// </summary>
FileAndFeed = 3
}
/// <summary>Values that represent ForceType for load function.</summary>
public enum ForceType
{
/// <summary>An enumeration constant representing the invalid/default/unset option.</summary>
INVALID = 0,
/// <summary>An enumeration constant representing the force file option.</summary>
FORCE_FILE = 1,
/// <summary>An enumeration constant representing the force web option.</summary>
FORCE_WEB = 2
}
#endregion
#region Property
/// <summary>
/// Gets or sets the Model.
/// </summary>
public T Model
public new CampusAppWP8.Utility.File File
{
get
{
return this.model;
return (CampusAppWP8.Utility.File)base.File;
}
set
protected set
{
this.model = value;
base.File = value;
}
}
/// <summary>
/// Gets or sets the api
/// </summary>
public new HttpRequest Api
{
get
{
return (HttpRequest)base.Api;
}
protected set
{
base.Api = value;
}
}
#endregion
#region Method
#region public
/// <summary>
/// Forces a update from web.
/// </summary>
public void ForceWebUpdate()
{
this.LoadData(ForceType.FORCE_WEB);
}
/// <summary>
/// Forces a update from file.
/// </summary>
public void ForceReadFile()
{
this.LoadData(ForceType.FORCE_FILE);
}
/// <summary>
/// Load the data if necessary, from web or from file, regarding if
/// the file data is up to date.
/// </summary>
/// <param name="force">if set/not invalid/not default, force to load from web or file</param>
public void LoadData(ForceType force = ForceType.INVALID)
{
this.RunOnIOCallback(this.OnLoading);
// check which source is used for loading the data
if (force == ForceType.INVALID)
{
// if the model is not up to date
if (this.CheckIsNotUpToDate(this.IsModelUpToDateOnLoad) == true)
{
force = ForceType.FORCE_FILE;
if (this.file != null)
{
// if the file does not exist or is size of 0 or is not
// up to date, then load from web
if ((this.file.Exist() == false)
|| (this.file.GetFileInfo().Length == 0)
|| (this.CheckIsNotUpToDate(this.IsFileUpToDateOnLoad) == true))
{
force = ForceType.FORCE_WEB;
}
}
else
{
// if the file object does not exist, load from web
force = ForceType.FORCE_WEB;
}
// if the web object does not exist, load from file
if (this.api == null)
{
force = ForceType.FORCE_FILE;
}
}
else
{
// if it is up to date, nothing has to be loaded
this.RunOnIOCallback(this.OnLoaded);
}
}
// load from web
if (force == ForceType.FORCE_WEB)
{
if (this.api != null)
{
if (this.paramizedUri != null)
{
this.api.HttpGet(this.paramizedUri, this.OnLoadDataComplete);
}
else
{
this.api.HttpGet(this.httpApiUri, this.OnLoadDataComplete);
}
}
else
{
// if web object does not exist, call OnFailed callbacks
this.RunOnFailedCallback(this.OnFailedWeb, this.OnFailedLoad);
}
}
// load from file
if (force == ForceType.FORCE_FILE)
{
if (this.file != null)
{
byte[] data = this.file.ReadFile();
if (data == null)
{
this.RunOnFailedCallback(this.OnFailedFile, this.OnFailedLoad);
}
else
{
if (data.Length > 0)
{
this.DeserializeModel(data);
}
this.RunOnIOCallback(this.OnLoaded);
}
}
else
{
// if file object does not exist, call OnFailed callbacks
this.RunOnFailedCallback(this.OnFailedFile, this.OnFailedLoad);
}
}
}
/// <summary>
/// Save the model data if necessary.
/// </summary>
/// <param name="force">force saving. DEFAULT: false</param>
public void SaveData(bool force = false)
{
if ((this.file != null)
&& ((this.CheckIsNotUpToDate(this.IsFileUpToDateOnSave) == true) || (force == true)))
{
this.RunOnIOCallback(this.OnSaving);
byte[] data = this.SerializeModel();
if ((this.OnSaved != null) && (this.OnFailedSave != null))
{
this.file.WriteFile(data, delegate { this.OnSaved(); }, delegate { this.OnFailedSave(); });
}
else if (this.OnSaved != null)
{
this.file.WriteFile(data, delegate { this.OnSaved(); }, null);
}
else if (this.OnFailedSave != null)
{
this.file.WriteFile(data, null, delegate { this.OnFailedSave(); });
}
else
{
this.file.WriteFile(data, null, null);
}
}
}
/// <summary>
/// Return the model io type.
/// </summary>
/// <returns>model io type</returns>
public ModelType GetModelType()
{
return this.modelType;
}
/// <summary>
/// Return the model.
/// </summary>
/// <returns>model object</returns>
public T GetModel()
{
return this.model;
}
/// <summary>
/// Create the parameterized uri.
/// </summary>
/// <param name="parameters">uri parameter list</param>
public void SetUriParams(List<UrlParamModel> parameters)
{
if (this.api != null)
{
this.paramizedUri = this.api.CreateGetUrl(parameters);
}
}
/// <summary>
/// Clear the parameterized uri.
/// </summary>
public void ClearUriParams()
{
this.paramizedUri = null;
}
#endregion
#region protected
/// <summary>
/// Abstract declaration of the model deserialize function.
/// Method overrides the base CheckLoadFileIsNotUpToDate Method
/// </summary>
/// <param name="modelData">model data as byte array</param>
/// <returns>true, is succeeded</returns>
protected abstract bool DeserializeModel(byte[] modelData);
/// <summary>
/// Abstract declaration of the model serialize function.
/// </summary>
/// <returns>model data as byte array</returns>
protected abstract byte[] SerializeModel();
/// <summary>
/// Check if the model io type is file.
/// </summary>
/// <returns>true, if the model io type has file.</returns>
protected bool IsFile()
/// <returns>true if it is not up-to-date, otherwise false</returns>
protected override bool CheckLoadFileIsNotUpToDate()
{
bool retValue = false;
if ((this.modelType & ModelType.File) != 0)
{
retValue = true;
}
return retValue;
return this.CheckIsNotUpToDate(this.IsFileUpToDateOnLoad);
}
/// <summary>
/// Check if the model io type is feed.
/// Method overrides the base CheckSaveFileIsNotUpToDate Method
/// </summary>
/// <returns>true if the model io type has feed.</returns>
protected bool IsHttpApi()
/// <returns>true if it is not up-to-date, otherwise false</returns>
protected override bool CheckSaveFileIsNotUpToDate()
{
return this.CheckIsNotUpToDate(this.IsFileUpToDateOnSave);
}
/// <summary>
/// Method overrides the base SendHttpGet Method
/// </summary>
/// <param name="url">the url</param>
protected override void SendHttpGet(Uri url)
{
((HttpRequest)this.Api).HttpGet(url, this.OnLoadDataComplete);
}
/// <summary>
/// Initializes the file object.
/// </summary>
protected override void InitFile()
{
if ((this.IsFile() == true)
&& (this.File == null))
{
this.File = new CampusAppWP8.Utility.File(this.FileName);
}
}
/// <summary>
/// Initializes the web object.
/// </summary>
protected override void InitHttpApi()
{
if ((this.IsHttpApi() == true)
&& (this.Api == null))
{
this.Api = new HttpRequest(this.HttpApiUri);
}
}
/// <summary>Check if model or file is not up to date.</summary>
/// <param name="checkFunc">The check function.</param>
/// <returns>true if model or file is not up to date, false if it is.</returns>
protected override bool CheckIsNotUpToDate(object checkFunc)
{
bool retValue = false;
if ((this.modelType & ModelType.Feed) != 0)
// if there is no check function, the model or file is not up to date
if (checkFunc == null)
{
retValue = true;
}
else
{
Type funcType = checkFunc.GetType();
if (funcType.Equals(typeof(IsFileUpToDate)))
{
retValue = !(checkFunc as IsFileUpToDate)(this.Model, this.File.GetFileInfo());
}
else if (funcType.Equals(typeof(IsModelUpToDate)))
{
retValue = !(checkFunc as IsModelUpToDate)(this.Model);
}
}
return retValue;
}
@@ -489,60 +189,6 @@ namespace CampusAppWP8
#region private
/// <summary>
/// Initialize the class. Is called by the constructors.
/// </summary>
/// <param name="modelType">model IO type</param>
/// <param name="fileName">name of the data file</param>
/// <param name="url">url of the feed data</param>
private void Init(ModelType modelType, string fileName, string url)
{
this.modelType = modelType;
if ((url != null) && (url.Equals(string.Empty) == false))
{
this.httpApiUri = new Uri(url, UriKind.Absolute);
}
this.fileName = fileName;
if ((this.IsFile() == true)
&& (fileName.Equals(string.Empty) == false))
{
this.InitFile();
}
if ((this.IsHttpApi() == true)
&& (url.Equals(string.Empty) == false))
{
this.InitHttpApi();
}
}
/// <summary>
/// Initializes the file object.
/// </summary>
private void InitFile()
{
if ((this.IsFile() == true)
&& (this.file == null))
{
this.file = new CampusAppWP8.Utility.File(this.fileName);
}
}
/// <summary>
/// Initializes the web object.
/// </summary>
private void InitHttpApi()
{
if ((this.IsHttpApi() == true)
&& (this.api == null))
{
this.api = new HttpRequest(this.httpApiUri);
}
}
/// <summary>
/// Is called after the loading from web is complete.
/// </summary>
@@ -553,7 +199,7 @@ namespace CampusAppWP8
Exception downloadError = e.Error;
if (downloadError != null)
{
this.RunOnFailedCallback(this.OnFailedWeb, this.OnFailedLoad);
this.FireLoadFailEvents();
}
else
{
@@ -569,66 +215,10 @@ namespace CampusAppWP8
this.DeserializeModel(data);
}
this.RunOnIOCallback(this.OnLoaded);
this.FireLoadCompletedEvents();
}
}
/// <summary>
/// Executes the on i/o callback operation.
/// </summary>
/// <param name="callbackFunc">The callback function.</param>
private void RunOnIOCallback(OnIO callbackFunc)
{
if (callbackFunc != null)
{
callbackFunc();
}
}
/// <summary>Executes the on failed callback operation.</summary>
/// <param name="specialFunc">The special function.</param>
/// <param name="defaultFunc">The default function.</param>
private void RunOnFailedCallback(OnFailed specialFunc, OnFailed defaultFunc)
{
if (specialFunc != null)
{
specialFunc();
}
else if (defaultFunc != null)
{
defaultFunc();
}
}
/// <summary>Check if model or file is not up to date.</summary>
/// <param name="checkFunc">The check function.</param>
/// <returns>true if model or file is not up to date, false if it is.</returns>
private bool CheckIsNotUpToDate(object checkFunc)
{
bool retValue = false;
// if there is no check function, the model or file is not up to date
if (checkFunc == null)
{
retValue = true;
}
else
{
Type funcType = checkFunc.GetType();
if (funcType.Equals(typeof(IsFileUpToDate)))
{
retValue = !(checkFunc as IsFileUpToDate)(this.model, this.file.GetFileInfo());
}
else if (funcType.Equals(typeof(IsModelUpToDate)))
{
retValue = !(checkFunc as IsModelUpToDate)(this.model);
}
}
return retValue;
}
#endregion
#endregion

View File

@@ -0,0 +1,156 @@
//-----------------------------------------------------------------------------
// <copyright file="OpeninghoursInstitutionWp8Model.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>fiedlchr</author>
// <sience>24.06.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Openinghours
{
using System.Globalization;
using System.Windows;
using System.Xml.Serialization;
/// <summary>
/// Model for menu
/// </summary>
public class OpeninghoursInstitutionWp8Model : CampusAppWPortalLib8.Model.Openinghours.OpeninghoursInstitutionModel
{
#region Property
/// <summary>
/// Gets the visibility state of the monday TextBlock.
/// </summary>
public Visibility VisibleMonday
{
get
{
return ((this.Monday == string.Empty) || (this.Monday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the tuesday TextBlock.
/// </summary>
public Visibility VisibleTuesday
{
get
{
return ((this.Tuesday == string.Empty) || (this.Tuesday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the wednesday TextBlock.
/// </summary>
public Visibility VisibleWednesday
{
get
{
return ((this.Wednesday == string.Empty) || (this.Wednesday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the thursday TextBlock.
/// </summary>
public Visibility VisibleThursday
{
get
{
return ((this.Thursday == string.Empty) || (this.Thursday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the friday TextBlock.
/// </summary>
public Visibility VisibleFriday
{
get
{
return ((this.Friday == string.Empty) || (this.Friday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the saturday TextBlock.
/// </summary>
public Visibility VisibleSaturday
{
get
{
return ((this.Saturday == string.Empty) || (this.Saturday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the sunday TextBlock.
/// </summary>
public Visibility VisibleSunday
{
get
{
return ((this.Sunday == string.Empty) || (this.Sunday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the comment.
/// </summary>
public Visibility VisibleComment
{
get
{
return ((this.Comment == string.Empty) || (this.Comment.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the email address.
/// </summary>
public Visibility VisibleEMail
{
get
{
return ((this.EMail == string.Empty) || (this.EMail.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the phone number.
/// </summary>
public Visibility VisiblePhone
{
get
{
return ((this.Phone == string.Empty) || (this.Phone.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the room.
/// </summary>
public Visibility VisibleRoom
{
get
{
return ((this.Room == string.Empty) || (this.Room.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the building.
/// </summary>
public Visibility VisibleBuilding
{
get
{
return ((this.Building == string.Empty) || (this.Building.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
#endregion
}
}

View File

@@ -0,0 +1,20 @@
//-----------------------------------------------------------------------------
// <copyright file="OpeninghoursWp8Model.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>fiedlchr</author>
// <sience>24.06.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Openinghours
{
using System.Xml.Serialization;
/// <summary>
/// Model for opening hours.
/// </summary>
[XmlRoot("root")]
public class OpeninghoursWp8Model : CampusAppWPortalLib8.Model.Openinghours.OpeninghoursModel<OpeninghoursInstitutionWp8Model>
{
}
}

View File

@@ -0,0 +1,77 @@
//-----------------------------------------------------------------------------
// <copyright file="PersonFunctionWp8Model.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>05.09.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Person
{
using System.Xml.Serialization;
using CampusAppWP8.Utility;
/// <summary>Person function model.</summary>
/// <remarks>Stubbfel, 05.09.2013.</remarks>
public class PersonFunctionWp8Model : CampusAppWPortalLib8.Model.Person.PersonFunctionModel
{
#region Property
/// <summary>Gets or sets the function.</summary>
/// <value>The function.</value>
[XmlAttribute("funktion")]
public new string Function
{
get
{
return base.Function;
}
set
{
if (value != this.Function)
{
base.Function = Wp8StringManager.StripAndDecodeHTML(value);
}
}
}
/// <summary>Gets or sets the appointment.</summary>
/// <value>The appointment.</value>
[XmlAttribute("einrichtung")]
public new string Appointment
{
get
{
return base.Appointment;
}
set
{
if (value != this.Appointment)
{
base.Appointment = Wp8StringManager.StripAndDecodeHTML(value);
}
}
}
/// <summary>Gets or sets the building.</summary>
/// <value>The building.</value>
[XmlAttribute("gebaeude")]
public new string Building
{
get
{
return base.Building;
}
set
{
if (value != this.Building)
{
base.Building = Wp8StringManager.StripAndDecodeHTML(value);
}
}
}
#endregion
}
}

View File

@@ -0,0 +1,29 @@
//-----------------------------------------------------------------------------
// <copyright file="PersonListWp8Model.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>05.09.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Person
{
using System.Xml.Serialization;
using CampusAppWPortalLib8.Model.Person;
/// <summary>Person list model.</summary>
/// <remarks>Stubbfel, 05.09.2013.</remarks>
[XmlRoot("Uebersicht")]
public class PersonListWp8Model : CampusAppWPortalLib8.Model.Person.PersonListModel<PersonWp8Model>
{
/// <summary>Gets a person.</summary>
/// <remarks>Stubbfel, 05.09.2013.</remarks>
/// <param name="id">The identifier.</param>
/// <returns>The person.</returns>
public new PersonWp8Model GetPerson(string id)
{
IPersonModel<IPersonFunctionModel> tmpPerson = base.GetPerson(id);
return tmpPerson as PersonWp8Model;
}
}
}

View File

@@ -0,0 +1,77 @@
//-----------------------------------------------------------------------------
// <copyright file="PersonWp8Model.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>05.09.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Person
{
using System.Xml.Serialization;
using CampusAppWP8.Utility;
/// <summary>Person model.</summary>
/// <remarks>Stubbfel, 05.09.2013.</remarks>
public class PersonWp8Model : CampusAppWPortalLib8.Model.Person.PersonModel<PersonFunctionWp8Model>
{
#region property
/// <summary>Gets or sets the akadgrad.</summary>
/// <value>The akadgrad.</value>
[XmlAttribute("akadgrad")]
public new string Akadgrad
{
get
{
return base.Akadgrad;
}
set
{
if (value != this.Akadgrad)
{
base.Akadgrad = Wp8StringManager.StripAndDecodeHTML(value);
}
}
}
/// <summary>Gets or sets the name of the sur.</summary>
/// <value>The name of the sur.</value>
[XmlAttribute("nachname")]
public new string SurName
{
get
{
return base.SurName;
}
set
{
if (value != this.SurName)
{
base.SurName = Wp8StringManager.StripAndDecodeHTML(value);
}
}
}
/// <summary>Gets or sets the person's first name.</summary>
/// <value>The name of the first.</value>
[XmlAttribute("vorname")]
public new string FirstName
{
get
{
return base.FirstName;
}
set
{
if (value != this.FirstName)
{
base.FirstName = Wp8StringManager.StripAndDecodeHTML(value);
}
}
}
#endregion
}
}

View File

@@ -9,6 +9,7 @@ namespace CampusAppWP8.Model.Setting
{
using System.Xml.Serialization;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model.Settings;
/// <summary>
/// Model for the profile of an user
@@ -35,72 +36,6 @@ namespace CampusAppWP8.Model.Setting
#endregion
#region Enums
/// <summary>
/// Specifies the degrees.
/// </summary>
public enum DegreeType
{
/// <summary>
/// bachelor degree
/// </summary>
BACHELOR = 82,
/// <summary>
/// master degree
/// </summary>
MASTER = 88,
/// <summary>
/// diploma degree
/// </summary>
DIPLOM = 11
}
/// <summary>
/// Specifies the role of the user.
/// </summary>
public enum RoleType
{
/// <summary>
/// for students (01).
/// </summary>
STUDENT = 1,
/// <summary>
/// for staffs (10).
/// </summary>
STAFF = 2,
}
/// <summary>
/// Specifies the campus of the user.
/// </summary>
public enum Campus
{
/// <summary>
/// Cottbus -> MainCampus
/// </summary>
CB_MAIN = 1,
/// <summary>
/// Cottbus -> NorthCampus
/// </summary>
CB_NORTH = 4,
/// <summary>
/// Cottbus -> SouthCampus
/// </summary>
CB_SOUTH = 2,
/// <summary>
/// Senftenberg -> MainCampus
/// </summary>
SFB_MAIN = 3
}
#endregion
#region Proberties
/// <summary>

View File

@@ -0,0 +1,123 @@
// <copyright file="CourseListPickerItemListWp8Model.cs" company="BTU/IIT">
// Company copyright tag.List
// </copyright>
// <author>stubbfel</author>
// <sience>25.07.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Utility
{
using System.Collections.Generic;
using System.Linq;
using CampusAppWP8.Feed.Utility;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>
/// This is a class for the courseList
/// </summary>
public class CourseListPickerItemListWp8Model : CampusAppWPortalLib8.Model.Utility.CourseListPickerItemListModel
{
#region Member
/// <summary>List of courses.</summary>
private CourseFeed courseList;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="CourseListPickerItemListWp8Model" /> class.
/// </summary>
public CourseListPickerItemListWp8Model()
{
}
#endregion
#region Events
/// <summary>
/// Delegate of the OnIO callback function.
/// </summary>
public delegate void OnIO();
/// <summary>
/// Callback pointer, called after loading.
/// </summary>
public event OnIO OnLoaded = null;
#endregion
#region Method
#region public
/// <summary>
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
/// </summary>
public void LoadCourseList()
{
if (this.courseList == null || this.courseList.Model == null)
{
this.courseList = new CourseFeed();
this.courseList.OnLoaded += new CourseFeed.OnIO(this.FeedIsReady);
this.courseList.OnFailedWeb += new CourseFeed.OnFailed(this.FeedIsFail);
this.courseList.OnFailedFile += new CourseFeed.OnFailed(this.FeedIsFail);
this.courseList.LoadData();
}
else
{
this.CallOnLoaded();
}
}
#endregion
#region private
/// <summary>Feed is fail.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
private void FeedIsFail()
{
this.FallBackList();
this.CallOnLoaded();
}
/// <summary>Feed is ready.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
private void FeedIsReady()
{
this.ConvertToListPickerItemModel(this.courseList.Model.CreateCourseList());
this.CallOnLoaded();
}
/// <summary>Converts a courseList to a list picker item model.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
/// <param name="courseList">List of courses.</param>
private void ConvertToListPickerItemModel(List<CourseModel> courseList)
{
foreach (CourseModel course in courseList)
{
this.AddItem(new ListPickerItemModel(course.CourseNumber, Wp8StringManager.StripAndDecodeHTML(course.CourseText)));
}
this.List = this.List.OrderBy(o => o.Text).ToList();
this.courseList.SaveData();
}
/// <summary>Call on loaded.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
private void CallOnLoaded()
{
if (this.OnLoaded != null)
{
this.OnLoaded();
}
}
#endregion
#endregion
}
}

View File

@@ -9,12 +9,14 @@ namespace CampusAppWP8.Model
{
using System.Text;
using CampusAppWPortalLib8.Utility;
using CampusAppWPortalLib8.Model;
using CampusAppWPortalLib8.Resources;
/// <summary>
/// Xml model io handler class.
/// </summary>
/// <typeparam name="T">model type</typeparam>
public abstract class XmlModel<T> : MainModel<T>
public abstract class XmlModel<T> : MainModel<T>, IXmlModel
{
#region Constructor
@@ -27,7 +29,7 @@ namespace CampusAppWP8.Model
public XmlModel(ModelType modelType, string fileName, string url)
: base(modelType, fileName, url)
{
this.ValidRootName = CampusAppWPortalLib8.Resources.Constants.XMLRootElementName;
this.ValidRootName = Constants.XMLRootElementName;
}
/// <summary>
@@ -39,17 +41,21 @@ namespace CampusAppWP8.Model
public XmlModel(ModelType modelType, string sourceName)
: base(modelType, sourceName)
{
this.ValidRootName = CampusAppWPortalLib8.Resources.Constants.XMLRootElementName;
this.ValidRootName = Constants.XMLRootElementName;
}
#endregion
#region Method
#region Property
/// <summary>
/// Gets or sets for the name of the root-tag
/// </summary>
protected string ValidRootName { get; set; }
public string ValidRootName { get; set; }
#endregion
#region Method
/// <summary>
/// Create the model from a xml byte array.

View File

@@ -11,9 +11,9 @@ namespace CampusAppWP8.Pages.Departments
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using CampusAppWP8.File.Departments;
using CampusAppWP8.Model.Departments;
using CampusAppWP8.File.Departments;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model.Departments;
using Microsoft.Phone.Controls;
/// <summary>
@@ -70,7 +70,7 @@ namespace CampusAppWP8.Pages.Departments
if (this.isNewInstance)
{
if ((DepartmentIndexPage.FavoriteFile == null) || (DepartmentIndexPage.FavoriteFile.GetModel() == null))
if ((DepartmentIndexPage.FavoriteFile == null) || (DepartmentIndexPage.FavoriteFile.Model == null))
{
DepartmentModel tempModel = null;
@@ -91,7 +91,7 @@ namespace CampusAppWP8.Pages.Departments
if (this.isSourceSet == false)
{
this.ContentPanel.ItemsSource = DepartmentIndexPage.GetFavoriteFile().GetModel().Faculties[0].Chairs;
this.ContentPanel.ItemsSource = DepartmentIndexPage.GetFavoriteFile().Model.Faculties[0].Chairs;
this.isSourceSet = true;
}
@@ -108,7 +108,7 @@ namespace CampusAppWP8.Pages.Departments
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
{
App.SaveToIsolatedStorage<DepartmentModel>(Constants.IsolatedStorage_DepartmentFavoriteModel, DepartmentIndexPage.FavoriteFile.GetModel());
App.SaveToIsolatedStorage<DepartmentModel>(Constants.IsolatedStorage_DepartmentFavoriteModel, DepartmentIndexPage.FavoriteFile.Model);
}
}
@@ -159,7 +159,7 @@ namespace CampusAppWP8.Pages.Departments
Button btn = this.lastClickedBtn as Button;
TextBlock btnText = btn.Content as TextBlock;
if (DepartmentIndexPage.GetFavoriteFile().GetModel().Faculties[0].RemoveChair(btnText.Text) == true)
if (DepartmentIndexPage.GetFavoriteFile().Model.Faculties[0].RemoveChair(btnText.Text) == true)
{
MessageBox.Show(AppResources.DeleteSucceeded);
}

View File

@@ -51,13 +51,13 @@ namespace CampusAppWP8.Pages.Departments
{
DepartmentIndexPage.feed = new DepartmentFeed(false);
}
DepartmentIndexPage.feed.OnLoaded += new DepartmentFeed.OnIO(this.SetupFacultyList);
DepartmentIndexPage.feed.OnFailedWeb += new DepartmentFeed.OnFailed(this.FeedIsFailedWeb);
DepartmentIndexPage.feed.OnFailedFile += new DepartmentFeed.OnFailed(this.FeedIsFailedFile);
DepartmentIndexPage.feed.LoadData(Utilities.GetLoadModus<Model.Departments.DepartmentModel>());
DepartmentIndexPage.feed.LoadData(Utilities.GetLoadModus<CampusAppWPortalLib8.Model.Departments.DepartmentModel>());
if (DepartmentIndexPage.favorite == null)
{
DepartmentIndexPage.favorite = new DepartmentFavoriteFile(false);
@@ -160,7 +160,7 @@ namespace CampusAppWP8.Pages.Departments
{
if (NavigationMode.Back == e.NavigationMode)
{
DepartmentIndexPage.favorite.SaveData();
DepartmentIndexPage.favorite.SaveData();
}
base.OnNavigatedFrom(e);
@@ -184,7 +184,7 @@ namespace CampusAppWP8.Pages.Departments
/// </summary>
private void SetupFacultyList()
{
this.FacultyList.ItemsSource = DepartmentIndexPage.feed.GetModel().Faculties;
this.FacultyList.ItemsSource = DepartmentIndexPage.feed.Model.Faculties;
this.progressBar.Visibility = Visibility.Collapsed;
}
@@ -193,14 +193,14 @@ namespace CampusAppWP8.Pages.Departments
/// </summary>
private void CheckFavoriteFeed()
{
if (DepartmentIndexPage.favorite.GetModel() == null)
if (DepartmentIndexPage.favorite.Model == null)
{
DepartmentIndexPage.favorite.Model = new Model.Departments.DepartmentModel();
DepartmentIndexPage.favorite.Model = new CampusAppWPortalLib8.Model.Departments.DepartmentModel();
}
if (DepartmentIndexPage.favorite.GetModel().Faculties.Count == 0)
if (DepartmentIndexPage.favorite.Model.Faculties.Count == 0)
{
DepartmentIndexPage.favorite.Model.Faculties.Add(new Model.Departments.FacultyModel("favorites"));
DepartmentIndexPage.favorite.Model.Faculties.Add(new CampusAppWPortalLib8.Model.Departments.FacultyModel("favorites"));
}
}

View File

@@ -17,10 +17,6 @@
<!-- LayoutRoot -->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.DataContext>
<viewModel:DepartmentModel />
</Grid.DataContext>
<ProgressBar x:Name="progressBar" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed" IsIndeterminate="True"/>
<!-- Pivot -->
<phone:Pivot x:Name="DepartmentPivot" Title="{Binding Path=LocalizedResources.DepartmentApp_Title, Source={StaticResource LocalizedStrings}}" ItemsSource="{Binding Faculties}">

View File

@@ -12,8 +12,8 @@ namespace CampusAppWP8.Pages.Departments
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using CampusAppWP8.Model.Departments;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Model.Departments;
using Microsoft.Phone.Controls;
/// <summary>
@@ -70,7 +70,7 @@ namespace CampusAppWP8.Pages.Departments
if (this.isNewInstance)
{
if ((DepartmentIndexPage.Feed == null) || (DepartmentIndexPage.Feed.GetModel() == null))
if ((DepartmentIndexPage.Feed == null) || (DepartmentIndexPage.Feed.Model == null))
{
DepartmentModel tempModel = null;
@@ -91,7 +91,7 @@ namespace CampusAppWP8.Pages.Departments
if (this.isSourceSet == false)
{
this.DepartmentPivot.ItemsSource = DepartmentIndexPage.GetFeed().GetModel().Faculties;
this.DepartmentPivot.ItemsSource = DepartmentIndexPage.GetFeed().Model.Faculties;
this.isSourceSet = true;
}
@@ -103,7 +103,7 @@ namespace CampusAppWP8.Pages.Departments
int pivotIndexInt = int.Parse(pivotIndex) - 1;
// if the index is in the range of the array
if ((pivotIndexInt >= 0) && (pivotIndexInt < DepartmentIndexPage.GetFeed().GetModel().Faculties.Count()))
if ((pivotIndexInt >= 0) && (pivotIndexInt < DepartmentIndexPage.GetFeed().Model.Faculties.Count()))
{
DepartmentPivot.SelectedIndex = pivotIndexInt;
}
@@ -126,7 +126,7 @@ namespace CampusAppWP8.Pages.Departments
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
{
App.SaveToIsolatedStorage<DepartmentModel>(Constants.IsolatedStorage_DepartmentModel, DepartmentIndexPage.Feed.GetModel());
App.SaveToIsolatedStorage<DepartmentModel>(Constants.IsolatedStorage_DepartmentModel, DepartmentIndexPage.Feed.Model);
}
}
@@ -186,11 +186,11 @@ namespace CampusAppWP8.Pages.Departments
Button btn = this.lastClickedBtn as Button;
TextBlock btnText = btn.Content as TextBlock;
Model.Departments.ChairModel tempModel = DepartmentIndexPage.GetFeed().GetModel().Faculties[this.DepartmentPivot.SelectedIndex].GetChairModel(btnText.Text);
CampusAppWPortalLib8.Model.Departments.ChairModel tempModel = DepartmentIndexPage.GetFeed().Model.Faculties[this.DepartmentPivot.SelectedIndex].GetChairModel(btnText.Text);
if (tempModel != null)
{
DepartmentIndexPage.GetFavoriteFile().GetModel().Faculties[0].AddChair(tempModel);
DepartmentIndexPage.GetFavoriteFile().Model.Faculties[0].AddChair(tempModel);
}
}

View File

@@ -83,7 +83,7 @@ namespace CampusAppWP8.Pages.Dev
{
this.resultAppStoreKey = NavigationContext.QueryString[Constants.ParamQRResultKey];
}
this.isInAutofocus = true;
this.cam = new PhotoCamera(CameraType.Primary);
this.cam.Initialized += new EventHandler<CameraOperationCompletedEventArgs>(this.Cam_Initialized);
this.cam.AutoFocusCompleted += new EventHandler<CameraOperationCompletedEventArgs>(this.Cam_AutoFocusCompl);
@@ -176,7 +176,7 @@ namespace CampusAppWP8.Pages.Dev
/// <param name="e">Camera operation completed event information.</param>
private void Cam_AutoFocusCompl(object sender, CameraOperationCompletedEventArgs e)
{
this.isInAutofocus = false;
//this.isInAutofocus = false;
}
/// <summary>
@@ -195,8 +195,6 @@ namespace CampusAppWP8.Pages.Dev
this.cam.FocusAtPoint(
pos.Y / this.camView.ActualHeight,
1.0 - (pos.X / this.camView.ActualWidth));
this.isInAutofocus = true;
}
else if (this.cam.IsFocusSupported == true)
{
@@ -243,6 +241,10 @@ namespace CampusAppWP8.Pages.Dev
}
});
}
else
{
this.cam.Focus();
}
}
/// <summary>
@@ -255,12 +257,13 @@ namespace CampusAppWP8.Pages.Dev
while (!this.captureThreadExit)
{
if (this.isInAutofocus == false)
{
//if (this.isInAutofocus == false)
//{
this.cam.GetPreviewBufferArgb32(buffer);
this.OnCaptureImage(buffer, (int)resolution.Width, (int)resolution.Height);
}
this.isInAutofocus = true;
//}
System.Threading.Thread.Sleep(1000);
}

View File

@@ -96,7 +96,7 @@ namespace CampusAppWP8.Pages.Events
if (this.isNewInstance)
{
if ((EventIndexPage.GetEventFeed() == null) || (EventIndexPage.GetEventFeed().GetModel() == null))
if ((EventIndexPage.GetEventFeed() == null) || (EventIndexPage.GetEventFeed().Model == null))
{
RSSViewModel tempModel = null;
@@ -160,7 +160,7 @@ namespace CampusAppWP8.Pages.Events
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
{
App.SaveToIsolatedStorage<RSSViewModel>(Constants.IsolatedStorage_EventRSSModel, EventIndexPage.GetEventFeed().GetModel());
App.SaveToIsolatedStorage<RSSViewModel>(Constants.IsolatedStorage_EventRSSModel, EventIndexPage.GetEventFeed().Model);
}
if (this.synth != null)
@@ -222,7 +222,7 @@ namespace CampusAppWP8.Pages.Events
{
string ssmlPrompt = "<speak version=\"1.0\" ";
ssmlPrompt += "xmlns=\"http://www.w3.org/2001/10/synthesis\" xml:lang=\"de-DE\">";
ssmlPrompt += EventIndexPage.GetEventFeed().GetModel().Channel[0].Item[this.EventPivot.SelectedIndex].Text;
ssmlPrompt += EventIndexPage.GetEventFeed().Model.Channel[0].Item[this.EventPivot.SelectedIndex].Text;
ssmlPrompt += "</speak>";
this.isInSpeech = true;

View File

@@ -59,7 +59,7 @@ namespace CampusAppWP8.Pages.Exams
}
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
this.feed.LoadData(Utilities.GetLoadModus<Model.Exams.ExamListModel>());
this.feed.LoadData(Utilities.GetLoadModus<Model.Exams.ExamListWp8Model>());
}
/// <summary>
@@ -115,17 +115,17 @@ namespace CampusAppWP8.Pages.Exams
private void SetupExamList()
{
var bachelorList = from exam in this.feed.Model.Exams
where exam.DegreeNumber.Equals(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.BACHELOR).ToString())
where exam.DegreeNumber.Equals(((int)CampusAppWPortalLib8.Model.Settings.DegreeType.BACHELOR).ToString())
orderby exam.CourseText, exam.Version
select exam;
var masterList = from exam in this.feed.Model.Exams
where exam.DegreeNumber.Equals(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.MASTER).ToString())
where exam.DegreeNumber.Equals(((int)CampusAppWPortalLib8.Model.Settings.DegreeType.MASTER).ToString())
orderby exam.CourseText, exam.Version
select exam;
var diplomaList = from exam in this.feed.Model.Exams
where exam.DegreeNumber.Equals(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.DIPLOM).ToString())
where exam.DegreeNumber.Equals(((int)CampusAppWPortalLib8.Model.Settings.DegreeType.DIPLOM).ToString())
orderby exam.CourseText, exam.Version
select exam;
@@ -143,17 +143,17 @@ namespace CampusAppWP8.Pages.Exams
int result = App.LoadFromIsolatedStorage<int>(Constants.ExamPageModelKey);
if (result < 0 || result > 2)
{
Model.Setting.UserProfilModel.DegreeType degree = Settings.UserProfil.Degree;
CampusAppWPortalLib8.Model.Settings.DegreeType degree = Settings.UserProfil.Degree;
switch (degree)
{
case Model.Setting.UserProfilModel.DegreeType.BACHELOR:
case CampusAppWPortalLib8.Model.Settings.DegreeType.BACHELOR:
result = 0;
break;
case Model.Setting.UserProfilModel.DegreeType.MASTER:
case CampusAppWPortalLib8.Model.Settings.DegreeType.MASTER:
result = 1;
break;
case Model.Setting.UserProfilModel.DegreeType.DIPLOM:
case CampusAppWPortalLib8.Model.Settings.DegreeType.DIPLOM:
result = 2;
break;
default:

View File

@@ -13,11 +13,11 @@ namespace CampusAppWP8.Pages.Lecture
using System.Windows.Navigation;
using CampusAppWP8.Api.Lecture;
using CampusAppWP8.Model.Lecture;
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using Microsoft.Phone.Controls;
using CampusAppWPortalLib8.Model.Utility;
using Microsoft.Phone.Controls;
/// <summary>
/// Class for the LecturePage
@@ -73,7 +73,7 @@ namespace CampusAppWP8.Pages.Lecture
{
// delete all models
App.SaveToIsolatedStorage<LecturePageModel>(Constants.IsolatedStorage_LecturePageModel, null);
App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel, null);
App.SaveToIsolatedStorage<LectureWp8List>(Constants.IsolatedStorage_LectureModel, null);
}
else
{
@@ -207,7 +207,7 @@ namespace CampusAppWP8.Pages.Lecture
this.api.Model.FilterByCourseTitle(query);
}
App.SaveToIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel, this.api.Model);
App.SaveToIsolatedStorage<LectureWp8List>(Constants.IsolatedStorage_LectureModel, this.api.Model);
this.ProgressBar.Visibility = System.Windows.Visibility.Collapsed;
Uri url = new Uri(Constants.PathLecture_ResultPage, UriKind.Relative);
NavigationService.Navigate(url);

View File

@@ -40,7 +40,7 @@ namespace CampusAppWP8.Pages.Lecture
if (NavigationContext.QueryString.ContainsKey(Constants.ParamModelLecture_ModulNumber))
{
string number = NavigationContext.QueryString[Constants.ParamModelLecture_ModulNumber];
this.WebmailBrowser.Navigate(new Uri(Constants.UrlLecture_ModulBaseAddr + number, UriKind.Absolute));
this.WebmailBrowser.Navigate(new Uri(CampusAppWPortalLib8.Resources.Constants.UrlLecture_ModulBaseAddr + number, UriKind.Absolute));
}
base.OnNavigatedTo(e);

View File

@@ -57,10 +57,10 @@ namespace CampusAppWP8.Pages.Lecture
/// <param name="activityId">id of the activity</param>
private void LoadActivity(int activityId)
{
LectureList list = App.LoadFromIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel);
LectureWp8List list = App.LoadFromIsolatedStorage<LectureWp8List>(Constants.IsolatedStorage_LectureModel);
if (list != null)
{
LectureActivity activity = list.GetActivity(activityId);
LectureWp8Activity activity = list.GetActivity(activityId);
activity.CreateLectureString();
activity.CreateCourseString();
this.ContentPanel.DataContext = activity;
@@ -70,6 +70,5 @@ namespace CampusAppWP8.Pages.Lecture
#endregion
#endregion
}
}

View File

@@ -42,7 +42,7 @@ namespace CampusAppWP8.Pages.Lecture
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
LectureList list = App.LoadFromIsolatedStorage<LectureList>(Constants.IsolatedStorage_LectureModel);
LectureWp8List list = App.LoadFromIsolatedStorage<LectureWp8List>(Constants.IsolatedStorage_LectureModel);
if (list == null)
{
Uri url = new Uri(Constants.PathLecture_LecturePage, UriKind.Relative);

View File

@@ -67,8 +67,8 @@ namespace CampusAppWP8.Pages.Links
this.InitializeFeeds();
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
this.loadingFeeds = 2;
this.commonLinkFeed.LoadData(Utilities.GetLoadModus<Model.Link.LinkListModel>());
this.clubLinkFeed.LoadData(Utilities.GetLoadModus<Model.Link.LinkListModel>());
this.commonLinkFeed.LoadData(Utilities.GetLoadModus<CampusAppWPortalLib8.Model.Link.LinkListModel>());
this.clubLinkFeed.LoadData(Utilities.GetLoadModus<CampusAppWPortalLib8.Model.Link.LinkListModel>());
}
/// <summary>

View File

@@ -73,17 +73,17 @@ namespace CampusAppWP8.Pages.Mensa
if (menuItem1 != null)
{
menuItem1.Text = AppResources.Campus_CBMain;
menuItem1.Text = CampusAppWPortalLib8.Resources.AppResources.Campus_CBMain;
}
if (menuItem2 != null)
{
menuItem2.Text = AppResources.Campus_CBSouth;
menuItem2.Text = CampusAppWPortalLib8.Resources.AppResources.Campus_CBSouth;
}
if (menuItem3 != null)
{
menuItem3.Text = AppResources.Campus_SFBMain;
menuItem3.Text = CampusAppWPortalLib8.Resources.AppResources.Campus_SFBMain;
}
}
@@ -163,7 +163,7 @@ namespace CampusAppWP8.Pages.Mensa
/// Method initialize the Feed depends of a campus
/// </summary>
/// <param name="campus">campus parameter</param>
private void InitializeFeed(CampusAppWP8.Model.Setting.UserProfilModel.Campus campus)
private void InitializeFeed(CampusAppWPortalLib8.Model.Settings.Campus campus)
{
this.feed = MensaFeed.CreateCampusMensaFeed(campus);
this.feed.OnLoaded += new MensaFeed.OnIO(this.FeedIsReady);
@@ -335,7 +335,7 @@ namespace CampusAppWP8.Pages.Mensa
private void ApplicationBarMenuItem_Click(object sender, EventArgs e)
{
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
this.InitializeFeed(CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_MAIN);
this.InitializeFeed(CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN);
}
/// <summary>Event handler. Called by ApplicationBarMenuItem2 for click events.</summary>
@@ -345,7 +345,7 @@ namespace CampusAppWP8.Pages.Mensa
private void ApplicationBarMenuItem2_Click(object sender, EventArgs e)
{
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
this.InitializeFeed(CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_SOUTH);
this.InitializeFeed(CampusAppWPortalLib8.Model.Settings.Campus.CB_SOUTH);
}
/// <summary>Event handler. Called by ApplicationBarMenuItem3 for click events.</summary>
@@ -355,7 +355,7 @@ namespace CampusAppWP8.Pages.Mensa
private void ApplicationBarMenuItem3_Click(object sender, EventArgs e)
{
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
this.InitializeFeed(CampusAppWP8.Model.Setting.UserProfilModel.Campus.SFB_MAIN);
this.InitializeFeed(CampusAppWPortalLib8.Model.Settings.Campus.SFB_MAIN);
}
#endregion

View File

@@ -84,7 +84,7 @@ namespace CampusAppWP8.Pages.News
if (this.isNewInstance)
{
if ((NewsIndexPage.Feed == null) || (NewsIndexPage.Feed.GetModel() == null))
if ((NewsIndexPage.Feed == null) || (NewsIndexPage.Feed.Model == null))
{
RSSViewModel tempModel = null;
@@ -141,7 +141,7 @@ namespace CampusAppWP8.Pages.News
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
{
App.SaveToIsolatedStorage<RSSViewModel>(Constants.IsolatedStorage_NewsRSSModel, NewsIndexPage.GetNewsFeed().GetModel());
App.SaveToIsolatedStorage<RSSViewModel>(Constants.IsolatedStorage_NewsRSSModel, NewsIndexPage.GetNewsFeed().Model);
}
if (this.synth != null)
@@ -199,7 +199,7 @@ namespace CampusAppWP8.Pages.News
{
string ssmlPrompt = "<speak version=\"1.0\" ";
ssmlPrompt += "xmlns=\"http://www.w3.org/2001/10/synthesis\" xml:lang=\"de-DE\">";
ssmlPrompt += NewsIndexPage.GetNewsFeed().GetModel().Channel[0].Item[this.NewsPivot.SelectedIndex].Text;
ssmlPrompt += NewsIndexPage.GetNewsFeed().Model.Channel[0].Item[this.NewsPivot.SelectedIndex].Text;
ssmlPrompt += "</speak>";
this.isInSpeech = true;

View File

@@ -52,7 +52,7 @@ namespace CampusAppWP8.Pages.Openinghours
this.feed.OnLoaded += new OpeninghoursFeed.OnIO(this.FeedIsReady);
this.feed.OnFailedWeb += new OpeninghoursFeed.OnFailed(this.FeedIsFailedWeb);
this.feed.OnFailedFile += new OpeninghoursFeed.OnFailed(this.FeedIsFailedFile);
this.feed.LoadData(Utilities.GetLoadModus<Model.Openinghours.OpeninghoursModel>());
this.feed.LoadData(Utilities.GetLoadModus<Model.Openinghours.OpeninghoursWp8Model>());
}
this.isNewInstance = true;
@@ -79,11 +79,11 @@ namespace CampusAppWP8.Pages.Openinghours
*/
if (this.isNewInstance)
{
if ((this.feed == null) || (this.feed.GetModel() == null))
if ((this.feed == null) || (this.feed.Model == null))
{
OpeninghoursModel tempModel = null;
OpeninghoursWp8Model tempModel = null;
if ((tempModel = App.LoadFromIsolatedStorage<OpeninghoursModel>(Constants.IsolatedStorage_OpeninghoursModel)) != null)
if ((tempModel = App.LoadFromIsolatedStorage<OpeninghoursWp8Model>(Constants.IsolatedStorage_OpeninghoursModel)) != null)
{
this.feed.Model = tempModel;
this.FeedIsReady();
@@ -104,7 +104,7 @@ namespace CampusAppWP8.Pages.Openinghours
if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
{
App.SaveToIsolatedStorage<OpeninghoursModel>(Constants.IsolatedStorage_OpeninghoursModel, this.feed.GetModel());
App.SaveToIsolatedStorage<OpeninghoursWp8Model>(Constants.IsolatedStorage_OpeninghoursModel, this.feed.Model);
}
}

View File

@@ -12,13 +12,12 @@ namespace CampusAppWP8.Pages.Person
using System.Windows;
using CampusAppWP8.Api.Person;
using CampusAppWP8.Model.Person;
using CampusAppWP8.Model.Utility;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility.Lui.Button;
using CampusAppWP8.Utility.Lui.MessageBoxes;
using CampusAppWPortalLib8.Model.Utility;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>Person page.</summary>
/// <remarks>Stubbfel, 09.09.2013.</remarks>
@@ -115,7 +114,7 @@ namespace CampusAppWP8.Pages.Person
string personID = btn.PersonId as string;
int functionIndex = (int)btn.FunctionIndex;
PersonModel person = this.api.Model.GetPerson(personID);
PersonWp8Model person = this.api.Model.GetPerson(personID);
if (person == null)
{
return;

View File

@@ -14,6 +14,7 @@ namespace CampusAppWP8.Pages.Setting
using CampusAppWP8.Model.Utility;
using CampusAppWPortalLib8.Utility;
using Microsoft.Phone.Controls;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>
/// Class for the UserProfilePage
@@ -28,7 +29,7 @@ namespace CampusAppWP8.Pages.Setting
private UserProfilModel userProfil;
/// <summary>List of courses.</summary>
private CourseListPickerItemListModel courseList;
private CourseListPickerItemListWp8Model courseList;
#endregion
@@ -71,8 +72,8 @@ namespace CampusAppWP8.Pages.Setting
private void LoadListPicker()
{
this.ProgressBar.Visibility = Visibility.Visible;
this.courseList = new CourseListPickerItemListModel();
this.courseList.OnLoaded += new CourseListPickerItemListModel.OnIO(this.SetupListPickers);
this.courseList = new CourseListPickerItemListWp8Model();
this.courseList.OnLoaded += new CourseListPickerItemListWp8Model.OnIO(this.SetupListPickers);
this.courseList.LoadCourseList();
}
@@ -108,10 +109,10 @@ namespace CampusAppWP8.Pages.Setting
try
{
this.userProfil.Course = int.Parse(((ListPickerItemModel)this.Course.SelectedItem).Value);
this.userProfil.Degree = (CampusAppWP8.Model.Setting.UserProfilModel.DegreeType)Enum.Parse(typeof(CampusAppWP8.Model.Setting.UserProfilModel.DegreeType), ((ListPickerItemModel)this.Degree.SelectedItem).Value);
this.userProfil.Degree = (CampusAppWPortalLib8.Model.Settings.DegreeType)Enum.Parse(typeof(CampusAppWPortalLib8.Model.Settings.DegreeType), ((ListPickerItemModel)this.Degree.SelectedItem).Value);
this.userProfil.Semester = int.Parse(((ListPickerItemModel)this.Semster.SelectedItem).Value);
this.userProfil.Role = (CampusAppWP8.Model.Setting.UserProfilModel.RoleType)Enum.Parse(typeof(CampusAppWP8.Model.Setting.UserProfilModel.RoleType), ((ListPickerItemModel)this.Role.SelectedItem).Value);
this.userProfil.DefaultCampus = (CampusAppWP8.Model.Setting.UserProfilModel.Campus)Enum.Parse(typeof(CampusAppWP8.Model.Setting.UserProfilModel.Campus), ((ListPickerItemModel)this.Campus.SelectedItem).Value);
this.userProfil.Role = (CampusAppWPortalLib8.Model.Settings.RoleType)Enum.Parse(typeof(CampusAppWPortalLib8.Model.Settings.RoleType), ((ListPickerItemModel)this.Role.SelectedItem).Value);
this.userProfil.DefaultCampus = (CampusAppWPortalLib8.Model.Settings.Campus)Enum.Parse(typeof(CampusAppWPortalLib8.Model.Settings.Campus), ((ListPickerItemModel)this.Campus.SelectedItem).Value);
}
catch (Exception e)
{

View File

@@ -60,7 +60,7 @@ namespace CampusAppWP8.Pages.StudentCouncil
}
this.ProgressBar.Visibility = System.Windows.Visibility.Visible;
this.feed.LoadData(Utilities.GetLoadModus<Model.StudentCouncil.StudentCouncilListModel>());
this.feed.LoadData(Utilities.GetLoadModus<CampusAppWPortalLib8.Model.StudentCouncil.StudentCouncilListModel>());
}
/// <summary>

View File

@@ -105,42 +105,6 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Cottbus Hauptcampus ähnelt.
/// </summary>
public static string Campus_CBMain {
get {
return ResourceManager.GetString("Campus_CBMain", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Cottbus Nordcampus ähnelt.
/// </summary>
public static string Campus_CBNorth {
get {
return ResourceManager.GetString("Campus_CBNorth", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Cottbus Südcampus ähnelt.
/// </summary>
public static string Campus_CBSouth {
get {
return ResourceManager.GetString("Campus_CBSouth", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Senftenberg Hauptcampus ähnelt.
/// </summary>
public static string Campus_SFBMain {
get {
return ResourceManager.GetString("Campus_SFBMain", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Gebäudeinfos ausblenden ähnelt.
/// </summary>
@@ -195,33 +159,6 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Bachelor ähnelt.
/// </summary>
public static string Degree_Bachelor {
get {
return ResourceManager.GetString("Degree_Bachelor", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Diplom ähnelt.
/// </summary>
public static string Degree_Diploma {
get {
return ResourceManager.GetString("Degree_Diploma", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Master ähnelt.
/// </summary>
public static string Degree_Master {
get {
return ResourceManager.GetString("Degree_Master", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Löschen ähnelt.
/// </summary>
@@ -285,15 +222,6 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Fakultät ähnelt.
/// </summary>
public static string Faculty {
get {
return ResourceManager.GetString("Faculty", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Favoriten ähnelt.
/// </summary>
@@ -924,24 +852,6 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Mitarbeiter ähnelt.
/// </summary>
public static string Setting_RoleStaff {
get {
return ResourceManager.GetString("Setting_RoleStaff", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Student ähnelt.
/// </summary>
public static string Setting_RoleStudent {
get {
return ResourceManager.GetString("Setting_RoleStudent", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die Profileinstellungen ähnelt.
/// </summary>

View File

@@ -230,24 +230,12 @@
<data name="LectureApp_Type" xml:space="preserve">
<value>Veranstaltungsart</value>
</data>
<data name="Faculty" xml:space="preserve">
<value>Fakultät</value>
</data>
<data name="Professorship_chairs" xml:space="preserve">
<value>Lehrstühle</value>
</data>
<data name="NewsLinkBtn" xml:space="preserve">
<value>Link</value>
</data>
<data name="Degree_Bachelor" xml:space="preserve">
<value>Bachelor</value>
</data>
<data name="Degree_Diploma" xml:space="preserve">
<value>Diplom</value>
</data>
<data name="Degree_Master" xml:space="preserve">
<value>Master</value>
</data>
<data name="Building" xml:space="preserve">
<value>Gebäude</value>
</data>
@@ -314,12 +302,6 @@
<data name="Setting_UserSemester" xml:space="preserve">
<value>Semester</value>
</data>
<data name="Setting_RoleStaff" xml:space="preserve">
<value>Mitarbeiter</value>
</data>
<data name="Setting_RoleStudent" xml:space="preserve">
<value>Student</value>
</data>
<data name="ListPickerHeaderCourse" xml:space="preserve">
<value>Studiengangsauswahl</value>
</data>
@@ -338,18 +320,6 @@
<data name="MsgBox_GeoWatchOptInText" xml:space="preserve">
<value>Dürfen Positionsdaten enhoben und verwendet werden?</value>
</data>
<data name="Campus_CBMain" xml:space="preserve">
<value>Cottbus Hauptcampus</value>
</data>
<data name="Campus_CBNorth" xml:space="preserve">
<value>Cottbus Nordcampus</value>
</data>
<data name="Campus_CBSouth" xml:space="preserve">
<value>Cottbus Südcampus</value>
</data>
<data name="Campus_SFBMain" xml:space="preserve">
<value>Senftenberg Hauptcampus</value>
</data>
<data name="ListPickerHeaderCampus" xml:space="preserve">
<value>Campusauswahl</value>
</data>

View File

@@ -135,9 +135,6 @@
<data name="PathLecture_ResultDetailPage" xml:space="preserve">
<value>/Pages/Lecture/ResultDetailPage.xaml</value>
</data>
<data name="UrlLecture_ModulBaseAddr" xml:space="preserve">
<value>https://www.tu-cottbus.de/modul/</value>
</data>
<data name="UrlWebMail_Addr" xml:space="preserve">
<value>https://webmail.tu-cottbus.de</value>
</data>

View File

@@ -1221,15 +1221,6 @@ namespace CampusAppWP8.Resources {
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die https://www.tu-cottbus.de/modul/ ähnelt.
/// </summary>
public static string UrlLecture_ModulBaseAddr {
get {
return ResourceManager.GetString("UrlLecture_ModulBaseAddr", resourceCulture);
}
}
/// <summary>
/// Sucht eine lokalisierte Zeichenfolge, die http://www.tu-cottbus.de/campusapp-data/getdata.php?db=clubs&amp;app=2&amp;appversion=1 ähnelt.
/// </summary>

View File

@@ -17,7 +17,7 @@ namespace CampusAppWP8.Utility
/// <summary>
/// File class.
/// </summary>
public class File
public class File : AbstractFile
{
#region Member
@@ -45,15 +45,6 @@ namespace CampusAppWP8.Utility
#endregion
#region Events
/// <summary>
/// Delegation of the write callback function prototype.
/// </summary>
public delegate void WriteCallbackFunc();
#endregion
#region Method
#region public
@@ -61,7 +52,7 @@ namespace CampusAppWP8.Utility
/// <summary>Read data from file to a string.</summary>
/// <remarks>Stubbfel, 03.09.2013.</remarks>
/// <returns>data string.</returns>
public byte[] ReadFile()
public override byte[] ReadFile()
{
byte[] retValue = null;
@@ -78,7 +69,7 @@ namespace CampusAppWP8.Utility
/// <param name="data"> data byte array.</param>
/// <param name="onSavedCallback"> callback function, called after writing is done.</param>
/// <param name="onFailedCallback">callback function, called when writing failed.</param>
public void WriteFile(byte[] data, WriteCallbackFunc onSavedCallback, WriteCallbackFunc onFailedCallback)
public override void WriteFile(byte[] data, WriteCallbackFunc onSavedCallback, WriteCallbackFunc onFailedCallback)
{
Thread th = new Thread(delegate() { this.WriteAsync(data, onSavedCallback, onFailedCallback); });
th.Start();
@@ -98,9 +89,17 @@ namespace CampusAppWP8.Utility
/// Check if a file is existing.
/// </summary>
/// <returns>true, if file exists, otherwise false</returns>
public bool Exist()
public override bool Exist()
{
return this.GetFileInfo().Exists;
FileInfo info = this.GetFileInfo();
if (info.Exists && info.Length > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>Converts this object to a storage file.</summary>

View File

@@ -12,20 +12,13 @@ namespace CampusAppWP8.Utility
using System.Net;
using CampusAppWP8.Model.Utility;
using CampusAppWPortalLib8.Model.Utility;
using CampusAppWPortalLib8.Utility;
/// <summary>
/// Class realize the access of restful HttpRequest
/// </summary>
public class HttpRequest
public class HttpRequest : AbstractHttpRequest
{
#region Member
/// <summary>
/// BaseAddress of the webClient
/// </summary>
private string baseAddress;
#endregion
#region Constructor
/// <summary>
@@ -41,7 +34,7 @@ namespace CampusAppWP8.Utility
/// <param name="apiBaseAddress">the url of the HttpRequest base address</param>
public HttpRequest(Uri apiBaseAddress)
{
this.baseAddress = apiBaseAddress.AbsoluteUri;
this.BaseAddress = apiBaseAddress.AbsoluteUri;
}
#endregion
@@ -72,29 +65,6 @@ namespace CampusAppWP8.Utility
client.OpenReadAsync(url);
}
/// <summary>
/// Method create the Url for the http-get-method
/// </summary>
/// <param name="parameters"> list of parameters</param>
/// <returns>absolute API-Url include GetParameter</returns>
public Uri CreateGetUrl(List<UrlParamModel> parameters)
{
string paramterStr = string.Empty;
string seperator = string.Empty;
foreach (UrlParamModel parameter in parameters)
{
if (string.Empty.Equals(seperator))
{
seperator = parameter.ParamToken;
}
paramterStr += parameter.ToString();
}
string getUrlStr = this.baseAddress + seperator + paramterStr;
return new Uri(getUrlStr, UriKind.Absolute);
}
/// <summary>
/// Method realize the http-delete-method
/// </summary>

View File

@@ -18,6 +18,7 @@ namespace CampusAppWP8.Utility
using CampusAppWP8.Resources;
using Microsoft.Phone.Net.NetworkInformation;
using CampusAppWPortalLib8.Utility;
using CampusAppWPortalLib8.Model;
/// <summary>
/// Collection of utility functions.
@@ -347,15 +348,15 @@ namespace CampusAppWP8.Utility
/// <remarks>Stubbfel, 27.08.2013.</remarks>
/// <typeparam name="T">Generic type parameter.</typeparam>
/// <returns>The load modus&lt; t&gt;</returns>
public static MainModel<T>.ForceType GetLoadModus<T>()
public static ForceType GetLoadModus<T>()
{
if (Settings.AppSetting.OnlyWifi && !Settings.AppSetting.WifiEnable)
{
return MainModel<T>.ForceType.FORCE_FILE;
return ForceType.FORCE_FILE;
}
else
{
return MainModel<T>.ForceType.INVALID;
return ForceType.INVALID;
}
}

View File

@@ -33,14 +33,51 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Model\Departments\ChairModel.cs" />
<Compile Include="Model\Departments\DepartmentModel.cs" />
<Compile Include="Model\Departments\FacultyModel.cs" />
<Compile Include="Model\Exams\ExamListModel.cs" />
<Compile Include="Model\Exams\ExamModel.cs" />
<Compile Include="Model\ForcesTypes.cs" />
<Compile Include="Model\Lecture\LectureActivity.cs" />
<Compile Include="Model\Lecture\LectureCourse.cs" />
<Compile Include="Model\Lecture\LectureDate.cs" />
<Compile Include="Model\Lecture\LectureLecturer.cs" />
<Compile Include="Model\Lecture\LectureList.cs" />
<Compile Include="Model\Lecture\LectureModule.cs" />
<Compile Include="Model\Link\LinkListModel.cs" />
<Compile Include="Model\Link\LinkModel.cs" />
<Compile Include="Model\Mensa\MealModel.cs" />
<Compile Include="Model\Mensa\MenuModel.cs" />
<Compile Include="Model\Mensa\MenuWeekModel.cs" />
<Compile Include="Model\ModelTypes.cs" />
<Compile Include="Model\Openinghours\OpeninghoursInstitutionModel.cs" />
<Compile Include="Model\Openinghours\OpeninghoursModel.cs" />
<Compile Include="Model\Person\IPersonFunctionModel.cs" />
<Compile Include="Model\Person\IPersonModel.cs" />
<Compile Include="Model\Person\PersonFunctionModel.cs" />
<Compile Include="Model\Person\PersonListModel.cs" />
<Compile Include="Model\Person\PersonModel.cs" />
<Compile Include="Model\RSS\RSSChannelModel.cs" />
<Compile Include="Model\RSS\RSSModel.cs" />
<Compile Include="Model\RSS\RSSViewModel.cs" />
<Compile Include="Model\Settings\CampusTypes.cs" />
<Compile Include="Model\Settings\DegreeTypes.cs" />
<Compile Include="Model\Settings\RolesTypes.cs" />
<Compile Include="Model\StudentCouncil\StudentCouncilListModel.cs" />
<Compile Include="Model\StudentCouncil\StudentCouncilModel.cs" />
<Compile Include="Model\Utility\CampusListPickerItemListModel.cs" />
<Compile Include="Model\Utility\CleanUrlParamModel.cs" />
<Compile Include="Model\AbstractMainModel.cs" />
<Compile Include="Model\Utility\CourseListPickerItemListModel.cs" />
<Compile Include="Model\Utility\CourseModel.cs" />
<Compile Include="Model\Utility\DegreeListPickerItemListModel.cs" />
<Compile Include="Model\Utility\ListPickerItemListModel.cs" />
<Compile Include="Model\Utility\ListPickerItemModel.cs" />
<Compile Include="Model\Utility\RoleListPickerItemListModel.cs" />
<Compile Include="Model\Utility\SemesterListPickerItemListModel.cs" />
<Compile Include="Model\Utility\URLParamModel.cs" />
<Compile Include="Model\IXmlModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources\AppResources.Designer.cs">
<DependentUpon>AppResources.resx</DependentUpon>
@@ -54,6 +91,7 @@
</Compile>
<Compile Include="Utility\AbstractHttpRequest.cs" />
<Compile Include="Utility\AbstractBackgroundTasks.cs" />
<Compile Include="Utility\AbstractFile.cs" />
<Compile Include="Utility\Logger.cs" />
<Compile Include="Utility\DefaultStringManager.cs" />
<Compile Include="Utility\XmlManager.cs" />

View File

@@ -0,0 +1,577 @@
//-----------------------------------------------------------------------------
// <copyright file="AbstractMainModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>fiedlchr</author>
// <sience>05.07.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model
{
using System;
using System.Collections.Generic;
using CampusAppWPortalLib8.Model.Utility;
using CampusAppWPortalLib8.Utility;
/// <summary>
/// abstract Base model io handling class.
/// </summary>
/// <typeparam name="T">model type</typeparam>
public abstract class AbstractMainModel<T>
{
#region Member
/// <summary>
/// File object.
/// </summary>
private AbstractFile file = null;
/// <summary>
/// Model io type.
/// </summary>
private ModelType modelType;
/// <summary>
/// Model object.
/// </summary>
private T model = default(T);
/// <summary>
/// Web object.
/// </summary>
private AbstractHttpRequest api = null;
/// <summary>
/// Filename of saved data.
/// </summary>
private string fileName = string.Empty;
/// <summary>
/// Url of the feed data.
/// </summary>
private Uri httpApiUri = null;
/// <summary>
/// Parameterized uri of the feed.
/// </summary>
private Uri paramizedUri = null;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="AbstractMainModel{T}" /> class.
/// </summary>
/// <param name="modelType">Model IO type</param>
/// <param name="fileName">name of the file</param>
/// <param name="url">url of the feed</param>
public AbstractMainModel(ModelType modelType, string fileName, string url)
{
this.Init(modelType, fileName, url);
}
/// <summary>
/// Initializes a new instance of the <see cref="AbstractMainModel{T}" /> class.
/// </summary>
/// <param name="modelType">Model IO type</param>
/// <param name="sourceName">name of the file or the url of the feed</param>
public AbstractMainModel(ModelType modelType, string sourceName)
{
if (modelType == ModelType.File)
{
this.Init(modelType, sourceName, string.Empty);
}
else if (modelType == ModelType.Feed)
{
this.Init(modelType, string.Empty, sourceName);
}
else
{
throw new NotSupportedException("Wrong constructor was called for Feed and File support.");
}
}
#endregion
#region Events
/// <summary>
/// Delegate of the OnIO callback function.
/// </summary>
public delegate void OnIO();
/// <summary>
/// Delegate of the OnFailed(File/Web) callback function.
/// </summary>
public delegate void OnFailed();
/// <summary>
/// Delegate of the IsModelUpToDate callback function.
/// </summary>
/// <param name="model">data model</param>
/// <returns>true, model is up to date</returns>
public delegate bool IsModelUpToDate(T model);
/// <summary>
/// Callback pointer, called before loading.
/// </summary>
public event OnIO OnLoading = null;
/// <summary>
/// Callback pointer, called after loading.
/// </summary>
public event OnIO OnLoaded = null;
/// <summary>
/// Callback pointer, called before saving.
/// </summary>
public event OnIO OnSaving = null;
/// <summary>
/// Callback pointer, called after saving.
/// </summary>
public event OnIO OnSaved = null;
/// <summary>
/// Callback pointer, called after failed file loading.
/// </summary>
public event OnFailed OnFailedFile = null;
/// <summary>
/// Callback pointer, called after failed web loading.
/// </summary>
public event OnFailed OnFailedWeb = null;
/// <summary>
/// Callback pointer, called after failed file or web loading, if there
/// is no specialized onFailed callback set.
/// </summary>
public event OnFailed OnFailedLoad = null;
/// <summary>
/// Callback pointer, called after failed saving data to file.
/// </summary>
public event OnFailed OnFailedSave = null;
/// <summary>
/// Callback pointer, for checking if model is up to date at loading.
/// </summary>
public event IsModelUpToDate IsModelUpToDateOnLoad = null;
/// <summary>
/// Callback pointer, for checking if model is up to date at saving.
/// (currently unused)
/// </summary>
#pragma warning disable 0067
public event IsModelUpToDate IsModelUpToDateOnSave = null;
#endregion
#region Property
/// <summary>
/// Gets or sets the Model.
/// </summary>
public T Model
{
get
{
return this.model;
}
set
{
this.model = value;
}
}
/// <summary>
/// Gets or sets the File.
/// </summary>
public AbstractFile File
{
get { return this.file; }
protected set { this.file = value; }
}
/// <summary>
/// Gets or sets the ModelType.
/// </summary>
public ModelType ModelType
{
get { return this.modelType; }
protected set { this.modelType = value; }
}
/// <summary>
/// Gets or sets the Api.
/// </summary>
public AbstractHttpRequest Api
{
get { return this.api; }
protected set { this.api = value; }
}
/// <summary>
/// Gets or sets the ApiUrl.
/// </summary>
public Uri HttpApiUri
{
get { return this.httpApiUri; }
protected set { this.httpApiUri = value; }
}
/// <summary>
/// Gets or sets the FileName.
/// </summary>
public string FileName
{
get { return this.fileName; }
protected set { this.fileName = value; }
}
#endregion
#region Method
#region public
/// <summary>
/// Method Fire all Events for fail load
/// </summary>
public void FireLoadFailEvents()
{
this.RunOnFailedCallback(this.OnFailedWeb, this.OnFailedLoad);
}
/// <summary>
/// Method Fire all Events for load is complete
/// </summary>
public void FireLoadCompletedEvents()
{
this.RunOnIOCallback(this.OnLoaded);
}
/// <summary>
/// Forces a update from web.
/// </summary>
public void ForceWebUpdate()
{
this.LoadData(ForceType.FORCE_WEB);
}
/// <summary>
/// Forces a update from file.
/// </summary>
public void ForceReadFile()
{
this.LoadData(ForceType.FORCE_FILE);
}
/// <summary>
/// Load the data if necessary, from web or from file, regarding if
/// the file data is up to date.
/// </summary>
/// <param name="force">if set/not invalid/not default, force to load from web or file</param>
public void LoadData(ForceType force = ForceType.INVALID)
{
this.RunOnIOCallback(this.OnLoading);
// check which source is used for loading the data
if (force == ForceType.INVALID)
{
// if the model is not up to date
if (this.CheckIsNotUpToDate(this.IsModelUpToDateOnLoad) == true)
{
force = ForceType.FORCE_FILE;
if (this.file != null)
{
// if the file does not exist or is size of 0 or is not
// up to date, then load from web
if ((this.file.Exist() == false)
|| (this.CheckLoadFileIsNotUpToDate() == true))
{
force = ForceType.FORCE_WEB;
}
}
else
{
// if the file object does not exist, load from web
force = ForceType.FORCE_WEB;
}
// if the web object does not exist, load from file
if (this.api == null)
{
force = ForceType.FORCE_FILE;
}
}
else
{
// if it is up to date, nothing has to be loaded
this.RunOnIOCallback(this.OnLoaded);
}
}
// load from web
if (force == ForceType.FORCE_WEB)
{
if (this.api != null)
{
if (this.paramizedUri != null)
{
this.SendHttpGet(this.paramizedUri);
}
else
{
this.SendHttpGet(this.httpApiUri);
}
}
else
{
// if web object does not exist, call OnFailed callbacks
this.RunOnFailedCallback(this.OnFailedWeb, this.OnFailedLoad);
}
}
// load from file
if (force == ForceType.FORCE_FILE)
{
if (this.file != null)
{
byte[] data = this.file.ReadFile();
if (data == null)
{
this.RunOnFailedCallback(this.OnFailedFile, this.OnFailedLoad);
}
else
{
if (data.Length > 0)
{
this.DeserializeModel(data);
}
this.RunOnIOCallback(this.OnLoaded);
}
}
else
{
// if file object does not exist, call OnFailed callbacks
this.RunOnFailedCallback(this.OnFailedFile, this.OnFailedLoad);
}
}
}
/// <summary>
/// Save the model data if necessary.
/// </summary>
/// <param name="force">force saving. DEFAULT: false</param>
public void SaveData(bool force = false)
{
if ((this.file != null)
&& ((this.CheckSaveFileIsNotUpToDate() == true) || (force == true)))
{
this.RunOnIOCallback(this.OnSaving);
byte[] data = this.SerializeModel();
if ((this.OnSaved != null) && (this.OnFailedSave != null))
{
this.file.WriteFile(data, delegate { this.OnSaved(); }, delegate { this.OnFailedSave(); });
}
else if (this.OnSaved != null)
{
this.file.WriteFile(data, delegate { this.OnSaved(); }, null);
}
else if (this.OnFailedSave != null)
{
this.file.WriteFile(data, null, delegate { this.OnFailedSave(); });
}
else
{
this.file.WriteFile(data, null, null);
}
}
}
/// <summary>
/// Return the model io type.
/// </summary>
/// <returns>model io type</returns>
public ModelType GetModelType()
{
return this.modelType;
}
/// <summary>
/// Create the parameterized uri.
/// </summary>
/// <param name="parameters">uri parameter list</param>
public void SetUriParams(List<UrlParamModel> parameters)
{
if (this.api != null)
{
this.paramizedUri = this.api.CreateGetUrl(parameters);
}
}
/// <summary>
/// Clear the parameterized uri.
/// </summary>
public void ClearUriParams()
{
this.paramizedUri = null;
}
#endregion
#region protected
/// <summary>
/// Abstract declaration of the model deserialize function.
/// </summary>
/// <param name="modelData">model data as byte array</param>
/// <returns>true, is succeeded</returns>
protected abstract bool DeserializeModel(byte[] modelData);
/// <summary>
/// Abstract declaration of the model serialize function.
/// </summary>
/// <returns>model data as byte array</returns>
protected abstract byte[] SerializeModel();
/// <summary>
/// Method send a HttpGet
/// </summary>
/// <param name="url">the url</param>
protected abstract void SendHttpGet(Uri url);
/// <summary>
/// Method check if model or file is Not up-to-date
/// </summary>
/// <param name="checkFunc">the check function</param>
/// <returns>true if it is not up-to-date, otherwise false</returns>
protected abstract bool CheckIsNotUpToDate(object checkFunc);
/// <summary>
/// Method check if file is Not up-to-date for load process
/// </summary>
/// <returns>true if it is not up-to-date, otherwise false</returns>
protected abstract bool CheckLoadFileIsNotUpToDate();
/// <summary>
/// Method check if file is Not up-to-date for load process
/// </summary>
/// <returns>true if it is not up-to-date, otherwise false</returns>
protected abstract bool CheckSaveFileIsNotUpToDate();
/// <summary>
/// Initializes the file object.
/// </summary>
protected abstract void InitFile();
/// <summary>
/// Initializes the web object.
/// </summary>
protected abstract void InitHttpApi();
/// <summary>
/// Check if the model io type is file.
/// </summary>
/// <returns>true, if the model io type has file.</returns>
protected bool IsFile()
{
bool retValue = false;
if ((this.modelType & ModelType.File) != 0)
{
retValue = true;
}
return retValue;
}
/// <summary>
/// Check if the model io type is feed.
/// </summary>
/// <returns>true if the model io type has feed.</returns>
protected bool IsHttpApi()
{
bool retValue = false;
if ((this.modelType & ModelType.Feed) != 0)
{
retValue = true;
}
return retValue;
}
#endregion
#region private
/// <summary>
/// Initialize the class. Is called by the constructors.
/// </summary>
/// <param name="modelType">model IO type</param>
/// <param name="fileName">name of the data file</param>
/// <param name="url">url of the feed data</param>
private void Init(ModelType modelType, string fileName, string url)
{
this.modelType = modelType;
if ((url != null) && (url.Equals(string.Empty) == false))
{
this.httpApiUri = new Uri(url, UriKind.Absolute);
}
this.fileName = fileName;
if ((this.IsFile() == true)
&& (fileName.Equals(string.Empty) == false))
{
this.InitFile();
}
if ((this.IsHttpApi() == true)
&& (url.Equals(string.Empty) == false))
{
this.InitHttpApi();
}
}
/// <summary>
/// Executes the on i/o callback operation.
/// </summary>
/// <param name="callbackFunc">The callback function.</param>
private void RunOnIOCallback(OnIO callbackFunc)
{
if (callbackFunc != null)
{
callbackFunc();
}
}
/// <summary>Executes the on failed callback operation.</summary>
/// <param name="specialFunc">The special function.</param>
/// <param name="defaultFunc">The default function.</param>
private void RunOnFailedCallback(OnFailed specialFunc, OnFailed defaultFunc)
{
if (specialFunc != null)
{
specialFunc();
}
else if (defaultFunc != null)
{
defaultFunc();
}
}
#endregion
#endregion
}
}

View File

@@ -5,7 +5,7 @@
// <author>fiedlchr</author>
// <sience>24.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Departments
namespace CampusAppWPortalLib8.Model.Departments
{
using System.Globalization;
using System.Xml.Serialization;

View File

@@ -5,7 +5,7 @@
// <author>fiedlchr</author>
// <sience>24.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Departments
namespace CampusAppWPortalLib8.Model.Departments
{
using System;
using System.Collections.ObjectModel;

View File

@@ -5,11 +5,11 @@
// <author>fiedlchr</author>
// <sience>24.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Departments
namespace CampusAppWPortalLib8.Model.Departments
{
using System.Collections.ObjectModel;
using System.Xml.Serialization;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Resources;
/// <summary>
/// Model for holding the faculty information.

View File

@@ -5,24 +5,25 @@
// <author>stubbfel</author>
// <sience>02.09.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Exams
namespace CampusAppWPortalLib8.Model.Exams
{
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Xml.Serialization;
using CampusAppWP8.Model.Utility;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>Exam list model.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
[XmlRoot("links")]
public class ExamListModel
public class ExamListModel<T> where T : ExamModel
{
#region Property
/// <summary>Gets or sets the exams.</summary>
/// <value>The exams.</value>
[XmlElement("link")]
public ObservableCollection<ExamModel> Exams { get; set; }
public ObservableCollection<T> Exams { get; set; }
#endregion
@@ -34,7 +35,7 @@ namespace CampusAppWP8.Model.Exams
public List<CourseModel> CreateCourseList()
{
List<CourseModel> result = new List<CourseModel>();
foreach (ExamModel exam in this.Exams)
foreach (T exam in this.Exams)
{
CourseModel tmpModel = new CourseModel(exam.CourseNumber, exam.CourseText);

View File

@@ -5,10 +5,10 @@
// <author>stubbfel</author>
// <sience>02.09.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Exams
namespace CampusAppWPortalLib8.Model.Exams
{
using System.Xml.Serialization;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Utility;
/// <summary>Exam model.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
@@ -56,16 +56,6 @@ namespace CampusAppWP8.Model.Exams
[XmlAttribute("link")]
public string Link { get; set; }
/// <summary>Gets the caption.</summary>
/// <value>The caption.</value>
public string Caption
{
get
{
return Wp8StringManager.StripAndDecodeHTML(this.CourseText + " (" + this.Type + "/" + this.Version + ")");
}
}
#endregion
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CampusAppWPortalLib8.Model
{
/// <summary>Values that represent ForceType for load function.</summary>
public enum ForceType
{
/// <summary>An enumeration constant representing the invalid/default/unset option.</summary>
INVALID = 0,
/// <summary>An enumeration constant representing the force file option.</summary>
FORCE_FILE = 1,
/// <summary>An enumeration constant representing the force web option.</summary>
FORCE_WEB = 2
}
}

View File

@@ -0,0 +1,27 @@
//-----------------------------------------------------------------------------
// <copyright file="IXmlModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>fiedlchr</author>
// <sience>05.07.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model
{
using CampusAppWPortalLib8.Utility;
/// <summary>
/// Xml model io handler class.
/// </summary>
/// <typeparam name="T">model type</typeparam>
public interface IXmlModel
{
#region Property
/// <summary>
/// Gets or sets for the name of the root-tag
/// </summary>
string ValidRootName { get; set; }
#endregion
}
}

View File

@@ -5,12 +5,12 @@
// <author>stubbfel</author>
// <sience>13.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
namespace CampusAppWPortalLib8.Model.Lecture
{
using System.Collections.ObjectModel;
using System.Xml.Serialization;
using CampusAppWP8.Resources;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Resources;
using CampusAppWPortalLib8.Utility;
/// <summary>
/// Model for a Activity
@@ -20,19 +20,19 @@ namespace CampusAppWP8.Model.Lecture
#region Members
/// <summary>The activity icon name lecture.</summary>
private const string ActivityIconNameLecture = "Vorlesung";
public const string ActivityTypeLecture = "Vorlesung";
/// <summary>The activity icon name seminar.</summary>
private const string ActivityIconNameSeminar = "Seminar";
public const string ActivityTypeSeminar = "Seminar";
/// <summary>The activity icon name practice.</summary>
private const string ActivityIconNamePract = "Übung";
public const string ActivityTypePract = "Übung";
/// <summary>The activity icon name lab.</summary>
private const string ActivityIconNameLab = "Labor";
public const string ActivityTypeLab = "Labor";
/// <summary>The activity icon name exam.</summary>
private const string ActivityIconNameExam = "Prüfung";
public const string ActivityTypeExam = "Prüfung";
/// <summary>
/// List of lecturer
@@ -54,9 +54,6 @@ namespace CampusAppWP8.Model.Lecture
/// </summary>
private string topic;
/// <summary>URL of the icon.</summary>
private string iconUrl;
#endregion
#region Constructor
@@ -199,21 +196,10 @@ namespace CampusAppWP8.Model.Lecture
{
if (value != this.topic)
{
this.topic = Wp8StringManager.StripAndDecodeHTML(value);
this.topic = value;
}
}
}
/// <summary>Gets URL of the icon.</summary>
/// <value>The icon URL.</value>
public string IconUrl
{
get
{
this.CreateIconUrl();
return this.iconUrl;
}
}
#endregion
#region Methods
@@ -228,10 +214,10 @@ namespace CampusAppWP8.Model.Lecture
string result = string.Empty;
foreach (LectureLecturer tmpLecturer in this.Lecturer)
{
result += Wp8StringManager.AddNewLine(tmpLecturer.ToString());
result += DefaultStringManager.AddNewLine(tmpLecturer.ToString());
}
this.LecturerString = Wp8StringManager.RemoveNewLine(result);
this.LecturerString = DefaultStringManager.RemoveNewLine(result);
}
/// <summary>
@@ -242,46 +228,10 @@ namespace CampusAppWP8.Model.Lecture
string result = string.Empty;
foreach (LectureCourse course in this.Course)
{
result += Wp8StringManager.AddNewLine(course.Title);
result += DefaultStringManager.AddNewLine(course.Title);
}
this.CourseString = Wp8StringManager.RemoveNewLine(result);
}
#endregion
#region private
/// <summary>Creates icon URL.</summary>
/// <remarks>Stubbfel, 12.09.2013.</remarks>
private void CreateIconUrl()
{
string typeStr = this.Type;
if (typeStr.Contains(LectureActivity.ActivityIconNameLecture))
{
this.iconUrl = Icons.Lecture;
}
else if (typeStr.Contains(LectureActivity.ActivityIconNameExam))
{
this.iconUrl = Icons.Exams;
}
else if (typeStr.Contains(LectureActivity.ActivityIconNamePract))
{
this.iconUrl = Icons.Practise;
}
else if (typeStr.Contains(LectureActivity.ActivityIconNameSeminar))
{
this.iconUrl = Icons.Seminar;
}
else if (typeStr.Contains(LectureActivity.ActivityIconNameLab))
{
this.iconUrl = Icons.Lab;
}
else
{
this.iconUrl = Icons.Info;
}
this.CourseString = DefaultStringManager.RemoveNewLine(result);
}
#endregion

View File

@@ -4,7 +4,7 @@
// <author>stubbfel</author>
// <sience>10.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
namespace CampusAppWPortalLib8.Model.Lecture
{
using System.Xml.Serialization;

View File

@@ -5,7 +5,7 @@
// <author>stubbfel</author>
// <sience>10.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
namespace CampusAppWPortalLib8.Model.Lecture
{
using System.Xml.Serialization;

View File

@@ -5,7 +5,7 @@
// <author>stubbfel</author>
// <sience>10.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
namespace CampusAppWPortalLib8.Model.Lecture
{
using System.Xml.Serialization;

View File

@@ -5,7 +5,7 @@
// <author>stubbfel</author>
// <sience>10.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
namespace CampusAppWPortalLib8.Model.Lecture
{
using System.Collections.ObjectModel;
using System.Linq;
@@ -14,13 +14,14 @@ namespace CampusAppWP8.Model.Lecture
/// <summary>
/// Model for a List of LectureActivity
/// </summary>
/// <typeparam name="T">T : LectureActivity</typeparam>
[XmlRoot("lsf_auszug")]
public class LectureList
public class LectureList<T> where T : LectureActivity
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="LectureList" /> class.
/// Initializes a new instance of the <see cref="LectureList {T}" /> class.
/// </summary>
public LectureList()
{
@@ -35,7 +36,7 @@ namespace CampusAppWP8.Model.Lecture
/// </summary>
[XmlArray("veranstaltungsliste")]
[XmlArrayItem("veranstaltung")]
public ObservableCollection<LectureActivity> Activities { get; set; }
public ObservableCollection<T> Activities { get; set; }
#endregion
@@ -46,9 +47,9 @@ namespace CampusAppWP8.Model.Lecture
/// </summary>
/// <param name="id"> id of the activity</param>
/// <returns> the activity (FirstOrDefault)</returns>
public LectureActivity GetActivity(int id)
public T GetActivity(int id)
{
LectureActivity activity = this.Activities.Where(p => p.Id == id).FirstOrDefault();
T activity = this.Activities.Where(p => p.Id == id).FirstOrDefault();
return activity;
}
@@ -57,12 +58,12 @@ namespace CampusAppWP8.Model.Lecture
/// <param name="filter">Specifies the filter.</param>
public void FilterByCourseTitle(string filter)
{
ObservableCollection<LectureActivity> filteredCollection = new ObservableCollection<LectureActivity>();
ObservableCollection<T> filteredCollection = new ObservableCollection<T>();
filter = filter.Trim().ToLower();
foreach (LectureActivity activity in this.Activities)
foreach (T activity in this.Activities)
{
activity.CreateCourseString();
if (activity.Title.ToLower().Contains(filter))
if (activity.Title.ToLower().Contains(filter))
{
filteredCollection.Add(activity);
}

View File

@@ -5,11 +5,11 @@
// <author>stubbfel</author>
// <sience>10.06.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Lecture
namespace CampusAppWPortalLib8.Model.Lecture
{
using System;
using System.Xml.Serialization;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Resources;
/// <summary>
/// Model for the module of an lecture

View File

@@ -6,7 +6,7 @@
// <sience>02.07.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Link
namespace CampusAppWPortalLib8.Model.Link
{
using System;
using System.Collections.ObjectModel;

View File

@@ -6,7 +6,7 @@
// <sience>02.07.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Link
namespace CampusAppWPortalLib8.Model.Link
{
using System.Globalization;
using System.Xml.Serialization;

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CampusAppWPortalLib8.Model
{
/// <summary>
/// Specifies the I/O type of the model.
/// </summary>
public enum ModelType
{
/// <summary>
/// Invalid/unset state.
/// </summary>
INVALID = 0,
/// <summary>
/// File only (01).
/// </summary>
File = 1,
/// <summary>
/// Feed only (10).
/// </summary>
Feed = 2,
/// <summary>
/// File and feed (11).
/// </summary>
FileAndFeed = 3
}
}

View File

@@ -6,7 +6,7 @@
// <sience>24.06.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Openinghours
namespace CampusAppWPortalLib8.Model.Openinghours
{
using System.Globalization;
using System.Windows;
@@ -426,138 +426,6 @@ namespace CampusAppWP8.Model.Openinghours
}
}
/// <summary>
/// Gets the visibility state of the monday TextBlock.
/// </summary>
public Visibility VisibleMonday
{
get
{
return ((this.dayMonday == string.Empty) || (this.dayMonday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the tuesday TextBlock.
/// </summary>
public Visibility VisibleTuesday
{
get
{
return ((this.dayTuesday == string.Empty) || (this.dayTuesday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the wednesday TextBlock.
/// </summary>
public Visibility VisibleWednesday
{
get
{
return ((this.dayWednesday == string.Empty) || (this.dayWednesday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the thursday TextBlock.
/// </summary>
public Visibility VisibleThursday
{
get
{
return ((this.dayThursday == string.Empty) || (this.dayThursday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the friday TextBlock.
/// </summary>
public Visibility VisibleFriday
{
get
{
return ((this.dayFriday == string.Empty) || (this.dayFriday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the saturday TextBlock.
/// </summary>
public Visibility VisibleSaturday
{
get
{
return ((this.daySaturday == string.Empty) || (this.daySaturday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the sunday TextBlock.
/// </summary>
public Visibility VisibleSunday
{
get
{
return ((this.daySunday == string.Empty) || (this.daySunday.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the comment.
/// </summary>
public Visibility VisibleComment
{
get
{
return ((this.Comment == string.Empty) || (this.Comment.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the email address.
/// </summary>
public Visibility VisibleEMail
{
get
{
return ((this.infoEmail == string.Empty) || (this.infoEmail.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the phone number.
/// </summary>
public Visibility VisiblePhone
{
get
{
return ((this.infoPhone == string.Empty) || (this.infoPhone.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the room.
/// </summary>
public Visibility VisibleRoom
{
get
{
return ((this.infoRoom == string.Empty) || (this.infoRoom.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
/// <summary>
/// Gets the visibility state of the building.
/// </summary>
public Visibility VisibleBuilding
{
get
{
return ((this.infoBuilding == string.Empty) || (this.infoBuilding.Length == 0)) ? Visibility.Collapsed : Visibility.Visible;
}
}
#endregion
#region Method

View File

@@ -6,7 +6,7 @@
// <sience>24.06.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Openinghours
namespace CampusAppWPortalLib8.Model.Openinghours
{
using System;
using System.Collections.ObjectModel;
@@ -16,7 +16,7 @@ namespace CampusAppWP8.Model.Openinghours
/// Model for opening hours.
/// </summary>
[XmlRoot("root")]
public class OpeninghoursModel
public class OpeninghoursModel<T> where T: OpeninghoursInstitutionModel
{
#region Member
@@ -28,7 +28,7 @@ namespace CampusAppWP8.Model.Openinghours
/// <summary>
/// Gets or sets feed information item list.
/// </summary>
private ObservableCollection<OpeninghoursInstitutionModel> institutions;
private ObservableCollection<T> institutions;
#endregion
@@ -39,7 +39,7 @@ namespace CampusAppWP8.Model.Openinghours
/// </summary>
public OpeninghoursModel()
{
this.institutions = new ObservableCollection<OpeninghoursInstitutionModel>();
this.institutions = new ObservableCollection<T>();
this.createTime = DateTime.Now;
}
@@ -63,7 +63,7 @@ namespace CampusAppWP8.Model.Openinghours
/// </summary>
[XmlArray("data")]
[XmlArrayItem("institution")]
public ObservableCollection<OpeninghoursInstitutionModel> Institutions
public ObservableCollection<T> Institutions
{
get
{

View File

@@ -0,0 +1,23 @@
//-----------------------------------------------------------------------------
// <copyright file="IPersonFunctionModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>01.10.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Person
{
/// <summary>
/// Interface for PersonFunctionModel classes
/// </summary>
public interface IPersonFunctionModel
{
/// <summary>Gets or sets the identifier of the person.</summary>
/// <value>The identifier of the person.</value>
string PersonID { get; set; }
/// <summary>Gets or sets zero-based index of the function.</summary>
/// <value>The function index.</value>
int FunctionIndex { get; set; }
}
}

View File

@@ -0,0 +1,30 @@
//-----------------------------------------------------------------------------
// <copyright file="IPersonModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>01.10.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Person
{
using System.Collections.ObjectModel;
/// <summary>
/// Interface for PersonModel classes
/// </summary>
/// <typeparam name="T">PersonFunctionModel template</typeparam>
public interface IPersonModel<T> where T : IPersonFunctionModel
{
/// <summary>Gets or sets the functions of a person.</summary>
/// <value>The functions.</value>
ObservableCollection<T> Functions { get; set; }
/// <summary>Gets or sets the identifier.</summary>
/// <value>The identifier.</value>
string ID { get; set; }
/// <summary>Sets person identifier to function.</summary>
/// <remarks>Stubbfel, 05.09.2013.</remarks>
void SetPersonIdToFunction();
}
}

View File

@@ -5,14 +5,14 @@
// <author>stubbfel</author>
// <sience>05.09.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Person
namespace CampusAppWPortalLib8.Model.Person
{
using System.Xml.Serialization;
using CampusAppWP8.Utility;
using CampusAppWPortalLib8.Utility;
/// <summary>Person function model.</summary>
/// <remarks>Stubbfel, 05.09.2013.</remarks>
public class PersonFunctionModel
public class PersonFunctionModel : IPersonFunctionModel
{
#region Member
@@ -55,7 +55,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != null && value != string.Empty && value != this.tel1)
{
this.tel1 = Wp8StringManager.CreateUniTelefonNumber(value);
this.tel1 = DefaultStringManager.CreateUniTelefonNumber(value);
}
}
}
@@ -74,7 +74,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != null && value != string.Empty && value != this.tel2)
{
this.tel2 = Wp8StringManager.CreateUniTelefonNumber(value);
this.tel2 = DefaultStringManager.CreateUniTelefonNumber(value);
}
}
}
@@ -93,7 +93,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != null && value != string.Empty && value != this.fax)
{
this.fax = Wp8StringManager.CreateUniTelefonNumber(value);
this.fax = DefaultStringManager.CreateUniTelefonNumber(value);
}
}
}
@@ -112,7 +112,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.function)
{
this.function = Wp8StringManager.StripAndDecodeHTML(value);
this.function = value;
}
}
}
@@ -131,7 +131,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.appointment)
{
this.appointment = Wp8StringManager.StripAndDecodeHTML(value);
this.appointment = value;
}
}
}
@@ -150,7 +150,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.building)
{
this.building = Wp8StringManager.StripAndDecodeHTML(value);
this.building = value;
}
}
}
@@ -167,7 +167,7 @@ namespace CampusAppWP8.Model.Person
set
{
if (value != null && value != this.mail && Wp8StringManager.IsValidEmail(value))
if (value != null && value != this.mail && DefaultStringManager.IsValidEmail(value))
{
this.mail = value;
}

View File

@@ -6,7 +6,7 @@
// <sience>05.09.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Person
namespace CampusAppWPortalLib8.Model.Person
{
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -14,15 +14,16 @@ namespace CampusAppWP8.Model.Person
/// <summary>Person list model.</summary>
/// <remarks>Stubbfel, 05.09.2013.</remarks>
/// <typeparam name="T">personModel template</typeparam>
[XmlRoot("Uebersicht")]
public class PersonListModel
public class PersonListModel<T>
{
#region Property
/// <summary>Gets or sets the persons.</summary>
/// <value>The persons.</value>
[XmlElement("person")]
public ObservableCollection<PersonModel> Persons { get; set; }
public ObservableCollection<T> Persons { get; set; }
#endregion
@@ -32,9 +33,13 @@ namespace CampusAppWP8.Model.Person
/// <remarks>Stubbfel, 05.09.2013.</remarks>
public void SetPersonIdToFunction()
{
foreach (PersonModel person in this.Persons)
foreach (T item in this.Persons)
{
person.SetPersonIdToFunction();
IPersonModel<IPersonFunctionModel> person = item as IPersonModel<IPersonFunctionModel>;
if (person != null)
{
person.SetPersonIdToFunction();
}
}
}
@@ -42,17 +47,23 @@ namespace CampusAppWP8.Model.Person
/// <remarks>Stubbfel, 05.09.2013.</remarks>
/// <param name="id">The identifier.</param>
/// <returns>The person.</returns>
public PersonModel GetPerson(string id)
public IPersonModel<IPersonFunctionModel> GetPerson(string id)
{
foreach (PersonModel tmpPerson in this.Persons)
foreach (T item in this.Persons)
{
IPersonModel<IPersonFunctionModel> tmpPerson = item as IPersonModel<IPersonFunctionModel>;
if (tmpPerson == null)
{
continue;
}
if (tmpPerson.ID.Equals(id))
{
return tmpPerson;
}
}
return null;
return default(IPersonModel<IPersonFunctionModel>);
}
/// <summary>Removes the non function and set identifiers person.</summary>
@@ -67,16 +78,22 @@ namespace CampusAppWP8.Model.Person
/// <remarks>Stubbfel, 05.09.2013.</remarks>
public void RemoveNonFunctionPerson()
{
List<PersonModel> removeList = new List<PersonModel>();
foreach (PersonModel tmpPerson in this.Persons)
List<T> removeList = new List<T>();
foreach (T item in this.Persons)
{
IPersonModel<IPersonFunctionModel> tmpPerson = item as IPersonModel<IPersonFunctionModel>;
if (tmpPerson == null)
{
continue;
}
if (tmpPerson.Functions.Count < 1)
{
removeList.Add(tmpPerson);
removeList.Add(item);
}
}
foreach (PersonModel removePerson in removeList)
foreach (T removePerson in removeList)
{
this.Persons.Remove(removePerson);
}

View File

@@ -5,15 +5,15 @@
// <author>stubbfel</author>
// <sience>05.09.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Person
namespace CampusAppWPortalLib8.Model.Person
{
using System.Collections.ObjectModel;
using System.Xml.Serialization;
using CampusAppWP8.Utility;
/// <summary>Person model.</summary>
/// <remarks>Stubbfel, 05.09.2013.</remarks>
public class PersonModel
/// <typeparam name="T">template for the PersonFunction-Class</typeparam>
public class PersonModel<T> : IPersonModel<T> where T : IPersonFunctionModel
{
#region Member
@@ -30,7 +30,7 @@ namespace CampusAppWP8.Model.Person
private string id;
/// <summary>The functions.</summary>
private ObservableCollection<PersonFunctionModel> functions;
private ObservableCollection<T> functions;
#endregion
@@ -70,7 +70,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.akadgrad)
{
this.akadgrad = Wp8StringManager.StripAndDecodeHTML(value);
this.akadgrad = value;
}
}
}
@@ -89,7 +89,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.surName)
{
this.surName = Wp8StringManager.StripAndDecodeHTML(value);
this.surName = value;
}
}
}
@@ -108,7 +108,7 @@ namespace CampusAppWP8.Model.Person
{
if (value != this.firstName)
{
this.firstName = Wp8StringManager.StripAndDecodeHTML(value);
this.firstName = value;
}
}
}
@@ -116,7 +116,7 @@ namespace CampusAppWP8.Model.Person
/// <summary>Gets or sets the functions of a person.</summary>
/// <value>The functions.</value>
[XmlElement("funktion")]
public ObservableCollection<PersonFunctionModel> Functions
public ObservableCollection<T> Functions
{
get
{
@@ -157,10 +157,14 @@ namespace CampusAppWP8.Model.Person
}
int index = 0;
foreach (PersonFunctionModel function in this.functions)
foreach (T item in this.functions)
{
function.PersonID = this.ID;
function.FunctionIndex = index++;
IPersonFunctionModel function = item as IPersonFunctionModel;
if (function != null)
{
function.PersonID = this.ID;
function.FunctionIndex = index++;
}
}
}

View File

@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CampusAppWPortalLib8.Model.Settings
{
/// <summary>
/// Specifies the campus of the user.
/// </summary>
public enum Campus
{
/// <summary>
/// Cottbus -> MainCampus
/// </summary>
CB_MAIN = 1,
/// <summary>
/// Cottbus -> NorthCampus
/// </summary>
CB_NORTH = 4,
/// <summary>
/// Cottbus -> SouthCampus
/// </summary>
CB_SOUTH = 2,
/// <summary>
/// Senftenberg -> MainCampus
/// </summary>
SFB_MAIN = 3
}
}

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CampusAppWPortalLib8.Model.Settings
{
/// <summary>
/// Specifies the degrees.
/// </summary>
public enum DegreeType
{
/// <summary>
/// bachelor degree
/// </summary>
BACHELOR = 82,
/// <summary>
/// master degree
/// </summary>
MASTER = 88,
/// <summary>
/// diploma degree
/// </summary>
DIPLOM = 11
}
}

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CampusAppWPortalLib8.Model.Settings
{
/// <summary>
/// Specifies the role of the user.
/// </summary>
public enum RoleType
{
/// <summary>
/// for students (01).
/// </summary>
STUDENT = 1,
/// <summary>
/// for staffs (10).
/// </summary>
STAFF = 2,
}
}

View File

@@ -5,7 +5,7 @@
// <author>stubbfel</author>
// <sience>02.07.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.StudentCouncil
namespace CampusAppWPortalLib8.Model.StudentCouncil
{
using System;
using System.Collections.Generic;

View File

@@ -6,10 +6,10 @@
// <sience>02.07.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.StudentCouncil
namespace CampusAppWPortalLib8.Model.StudentCouncil
{
using CampusAppWPortalLib8.Resources;
using System.Xml.Serialization;
using CampusAppWP8.Resources;
/// <summary>
/// Model for menu

View File

@@ -4,9 +4,10 @@
// <author>stubbfel</author>
// <sience>08.08.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Utility
namespace CampusAppWPortalLib8.Model.Utility
{
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Resources;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>
/// This Class creates a list of degrees
@@ -33,10 +34,10 @@ namespace CampusAppWP8.Model.Utility
/// </summary>
protected override void LoadList()
{
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_MAIN).ToString(), AppResources.Campus_CBMain));
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_NORTH).ToString(), AppResources.Campus_CBNorth));
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.Campus.CB_SOUTH).ToString(), AppResources.Campus_CBSouth));
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.Campus.SFB_MAIN).ToString(), AppResources.Campus_SFBMain));
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN).ToString(), AppResources.Campus_CBMain));
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_NORTH).ToString(), AppResources.Campus_CBNorth));
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_SOUTH).ToString(), AppResources.Campus_CBSouth));
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.Campus.SFB_MAIN).ToString(), AppResources.Campus_SFBMain));
}
#endregion

View File

@@ -4,80 +4,20 @@
// <author>stubbfel</author>
// <sience>25.07.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Utility
namespace CampusAppWPortalLib8.Model.Utility
{
using System.Collections.Generic;
using System.Linq;
using CampusAppWP8.Feed.Utility;
using CampusAppWP8.Utility;
/// <summary>
/// This is a class for the courseList
/// </summary>
public class CourseListPickerItemListModel : ListPickerItemListModel
public abstract class CourseListPickerItemListModel : ListPickerItemListModel
{
#region Member
/// <summary>List of courses.</summary>
private CourseFeed courseList;
#endregion
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="CourseListPickerItemListModel" /> class.
/// </summary>
public CourseListPickerItemListModel()
{
}
#endregion
#region Events
/// <summary>
/// Delegate of the OnIO callback function.
/// </summary>
public delegate void OnIO();
/// <summary>
/// Callback pointer, called after loading.
/// </summary>
public event OnIO OnLoaded = null;
#endregion
#region Method
#region public
/// <summary>
/// Overrides the LoadList-Method <see cref="ListPickerItemListModel"/>
/// </summary>
public void LoadCourseList()
{
if (this.courseList == null || this.courseList.Model == null)
{
this.courseList = new CourseFeed();
this.courseList.OnLoaded += new CourseFeed.OnIO(this.FeedIsReady);
this.courseList.OnFailedWeb += new CourseFeed.OnFailed(this.FeedIsFail);
this.courseList.OnFailedFile += new CourseFeed.OnFailed(this.FeedIsFail);
this.courseList.LoadData();
}
else
{
this.CallOnLoaded();
}
}
#endregion
#region private
#region Method
/// <summary>Fall back list.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
private void FallBackList()
protected void FallBackList()
{
this.AddItem(new ListPickerItemModel("017", "Bauingenieurwesen"));
this.AddItem(new ListPickerItemModel("021", "Betriebswirtschaftslehre"));
@@ -123,48 +63,6 @@ namespace CampusAppWP8.Model.Utility
this.List = this.List.OrderBy(o => o.Text).ToList();
}
/// <summary>Feed is fail.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
private void FeedIsFail()
{
this.FallBackList();
this.CallOnLoaded();
}
/// <summary>Feed is ready.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
private void FeedIsReady()
{
this.ConvertToListPickerItemModel(this.courseList.Model.CreateCourseList());
this.CallOnLoaded();
}
/// <summary>Converts a courseList to a list picker item model.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
/// <param name="courseList">List of courses.</param>
private void ConvertToListPickerItemModel(List<CourseModel> courseList)
{
foreach (CourseModel course in courseList)
{
this.AddItem(new ListPickerItemModel(course.CourseNumber, Wp8StringManager.StripAndDecodeHTML(course.CourseText)));
}
this.List = this.List.OrderBy(o => o.Text).ToList();
this.courseList.SaveData();
}
/// <summary>Call on loaded.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
private void CallOnLoaded()
{
if (this.OnLoaded != null)
{
this.OnLoaded();
}
}
#endregion
#endregion
}
}

View File

@@ -5,7 +5,7 @@
// <sience>25.07.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Utility
namespace CampusAppWPortalLib8.Model.Utility
{
using System;

View File

@@ -4,9 +4,10 @@
// <author>stubbfel</author>
// <sience>25.07.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Utility
namespace CampusAppWPortalLib8.Model.Utility
{
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Resources;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>
/// This Class creates a list of degrees
@@ -33,9 +34,9 @@ namespace CampusAppWP8.Model.Utility
/// </summary>
protected override void LoadList()
{
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.BACHELOR).ToString(), AppResources.Degree_Bachelor));
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.MASTER).ToString(), AppResources.Degree_Master));
this.AddItem(new ListPickerItemModel(((int)CampusAppWP8.Model.Setting.UserProfilModel.DegreeType.DIPLOM).ToString(), AppResources.Degree_Diploma));
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.DegreeType.BACHELOR).ToString(), AppResources.Degree_Bachelor));
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.DegreeType.MASTER).ToString(), AppResources.Degree_Master));
this.AddItem(new ListPickerItemModel(((int)CampusAppWPortalLib8.Model.Settings.DegreeType.DIPLOM).ToString(), AppResources.Degree_Diploma));
}
#endregion

View File

@@ -5,7 +5,7 @@
// <author>stubbfel</author>
// <sience>25.07.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Utility
namespace CampusAppWPortalLib8.Model.Utility
{
using System.Collections.Generic;

Some files were not shown because too many files have changed in this diff Show More