54 Commits
r#188 ... r#211

Author SHA1 Message Date
stubbfel
109ad354a3 Merge branch 'release/r#211' into develmaster 2013-10-02 13:36:12 +02:00
stubbfel
b702b0bfd9 Merge branch 'feature/#211' into develop 2013-10-02 13:28:07 +02:00
stubbfel
710b4c1e07 finish#211 2013-10-02 13:27:45 +02:00
stubbfel
d9838ddc16 fixes 2013-10-02 13:25:14 +02:00
stubbfel
ca3bd2381f mv lecture 2013-10-02 12:48:35 +02:00
stubbfel
6ea8d06a0e fix person models 2013-10-02 12:01:46 +02:00
stubbfel
87fc00071a setup commit 2013-10-01 16:34:48 +02:00
stubbfel
f3d0667310 mv personmodels 2013-10-01 16:34:03 +02:00
stubbfel
7668450d9c mv listpickers 2013-10-01 14:53:03 +02:00
stubbfel
dc3c527996 mv enums 2013-10-01 14:10:20 +02:00
stubbfel
80d05b9c45 mv studentcouncil 2013-10-01 13:51:15 +02:00
stubbfel
5de000ef17 mv exams 2013-10-01 13:49:53 +02:00
stubbfel
c26344fc40 mv CourseModel 2013-10-01 13:25:27 +02:00
stubbfel
cb3dd94b55 mv openinghours 2013-10-01 13:22:39 +02:00
stubbfel
71d113f819 mv linkModels 2013-10-01 12:04:21 +02:00
stubbfel
7b879319b2 set sylechecks 2013-10-01 11:54:50 +02:00
stubbfel
ca9eab8bd5 add abstractMainModel 2013-10-01 11:36:50 +02:00
stubbfel
8527f657fc end day 2013-09-30 18:43:40 +02:00
stubbfel
a898477394 Merge branch 'feature/#207' into develop 2013-09-30 16:04:46 +02:00
stubbfel
a0d68f8d3f add svgs 2013-09-30 16:04:36 +02:00
stubbfel
1753954c33 finish #190 2013-09-30 16:03:51 +02:00
stubbfel
ffa91ee8fd add icons 2013-09-30 15:21:37 +02:00
stubbfel
93c9bbe5d1 new offlinemap 2013-09-30 13:43:58 +02:00
stubbfel
c89fb9ab79 refactor backgroundagent 2013-09-30 11:41:41 +02:00
stubbfel
329e5525e3 fix #205 2013-09-30 11:01:57 +02:00
stubbfel
7c43d8cd70 Merge branch 'hotfix/#209' into develop 2013-09-30 10:40:06 +02:00
stubbfel
496fa63cf3 Merge branch 'hotfix/#209' into develmaster 2013-09-30 10:40:05 +02:00
stubbfel
1cd34afb9c add asserts 2013-09-30 10:39:46 +02:00
stubbfel
a8b2d33826 Merge branch 'release/r#201#2003' into develop 2013-09-26 15:40:19 +02:00
stubbfel
8dfb7693ac Merge branch 'release/r#201#2003' into develmaster 2013-09-26 15:40:06 +02:00
stubbfel
77b30b35c5 fix releas issue 2013-09-26 15:39:37 +02:00
stubbfel
d565b332e8 Merge branch 'feature/#203' into develop 2013-09-26 14:33:23 +02:00
stubbfel
995edbc32a add svgs 2013-09-26 14:33:11 +02:00
stubbfel
05168211b7 add docs 2013-09-26 14:32:22 +02:00
stubbfel
1dbd2be23f add lens extension 2013-09-26 11:24:53 +02:00
stubbfel
0396a62301 sort infolist 2013-09-25 13:41:26 +02:00
stubbfel
dd709f8937 add new offline map , zindex, new icon 2013-09-25 13:25:13 +02:00
stubbfel
5c1891459b extend campusmap 2013-09-24 16:21:26 +02:00
stubbfel
b075e5bb7e straro 2013-09-24 10:19:20 +02:00
stubbfel
750ebe4e22 Merge branch 'feature/#201' into develop 2013-09-23 18:48:53 +02:00
stubbfel
162c7042ae finish #201 2013-09-23 18:48:39 +02:00
stubbfel
85cb54f0e1 add roomlist 2013-09-23 18:06:02 +02:00
stubbfel
4047aacf0f att roomlistpage 2013-09-23 13:09:27 +02:00
stubbfel
94c538a429 Merge branch 'hotfix/#200' into develop 2013-09-23 10:30:37 +02:00
stubbfel
d23c6431f1 Merge branch 'hotfix/#200' into develmaster 2013-09-23 10:30:36 +02:00
stubbfel
fc0e7fba64 add else and pragma 2013-09-23 10:29:48 +02:00
stubbfel
87436ef6e8 Merge branch 'release/r' into develmaster 2013-09-19 14:27:57 +02:00
stubbfel
2f2237eae2 fix map issues 2013-09-19 14:27:28 +02:00
stubbfel
e734a750ff add new offline map 2013-09-19 14:09:12 +02:00
stubbfel
621aadc9a0 Merge branch 'release/r#196' into develmaster 2013-09-19 13:12:16 +02:00
stubbfel
7183d6de01 Merge branch 'feature/#196' into develop 2013-09-19 13:10:16 +02:00
stubbfel
771e1fc7b5 add nfc and qr to map 2013-09-19 12:34:53 +02:00
stubbfel
04ff3ad80b add filter pid medhod to stringmanager 2013-09-19 10:55:07 +02:00
stubbfel
e1b6a2d279 add qr and nfc scan to placeNewspage 2013-09-18 16:21:46 +02:00
1530 changed files with 38574 additions and 14935 deletions

View File

@@ -35,7 +35,7 @@ namespace CampusAppDLL.Model.Campusmap
this.Spatial = new SpsModel();
foreach (PlaceModel place in model.Places)
{
if (Campus.Equals(place.ParentId) || Campus.Equals(place.PlaceId))
if (place.ParentId.StartsWith(CBMainMapModel.Campus))
{
this.Spatial.Places.Add(place);
}

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

@@ -150,6 +150,13 @@ namespace CampusAppWP8
Settings.AppSetting.DevMode = false;
}
int appDeploy;
bool parseResult = int.TryParse(Constants.DeploymentNumber, out appDeploy);
if (!parseResult || Settings.AppSetting.DeploymentNumber != appDeploy)
{
Settings.AppSetting.InitApp = false;
}
this.UserSettingsLoaded();
Settings.AppSetting.UniNetwork = Utilities.IsUniNetworkAvailable();
@@ -243,6 +250,9 @@ namespace CampusAppWP8
// Behandeln Sie Rücksetzanforderungen zum Löschen des Backstack
RootFrame.Navigated += CheckForResetNavigation;
// Assign the lens example URI-mapper class to the application frame.
RootFrame.UriMapper = new AppUriMapper();
// Sicherstellen, dass keine erneute Initialisierung erfolgt
phoneApplicationInitialized = true;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

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>
@@ -112,25 +113,30 @@
<Compile Include="File\Exams\ExamFile.cs" />
<Compile Include="File\Places\PlacesFile.cs" />
<Compile Include="Model\BinaryModel.cs" />
<Compile Include="Model\Campusmap\CampusMapModel.cs" />
<Compile Include="Model\Campusmap\CBMainMapModel.cs" />
<Compile Include="Model\Campusmap\ClickAblePlacePinModel.cs" />
<Compile Include="Model\Campusmap\CurrentPositionPinModel.cs" />
<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>
<Compile Include="Pages\Exams\Exams.xaml.cs">
<DependentUpon>Exams.xaml</DependentUpon>
</Compile>
@@ -143,15 +149,18 @@
<Compile Include="Pages\PlaceNews\ShowPad.xaml.cs">
<DependentUpon>ShowPad.xaml</DependentUpon>
</Compile>
<Compile Include="Resources\Constants1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Constants.resx</DependentUpon>
</Compile>
<Compile Include="Utility\AppUriMapper.cs" />
<Compile Include="Utility\BackgroundTasks.cs" />
<Compile Include="Utility\Lui\Button\AddPersonButton.cs" />
<Compile Include="Utility\Lui\Tiles\TileCreator.cs" />
<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>
@@ -175,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>
@@ -224,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>
@@ -262,11 +258,6 @@
<DesignTime>True</DesignTime>
<DependentUpon>AppResources.resx</DependentUpon>
</Compile>
<Compile Include="Resources\Constants.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Constants.resx</DependentUpon>
</Compile>
<Compile Include="ThemelizedIcons.cs" />
<Compile Include="Utility\File.cs" />
<Compile Include="Utility\HttpRequest.cs" />
@@ -294,6 +285,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\Campusmap\RoomListPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\Departments\DepartmentFavoritePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -430,34 +425,48 @@
<Content Include="Assets\Icons\DarkTheme\add_contact_159.png" />
<Content Include="Assets\Icons\DarkTheme\btulogo_159.png" />
<Content Include="Assets\Icons\DarkTheme\campus_159.png" />
<Content Include="Assets\Icons\DarkTheme\carotte_159.png" />
<Content Include="Assets\Icons\DarkTheme\chicken_159.png" />
<Content Include="Assets\Icons\DarkTheme\current_position_159.png" />
<Content Include="Assets\Icons\DarkTheme\delete_159.png" />
<Content Include="Assets\Icons\DarkTheme\exams_159.png" />
<Content Include="Assets\Icons\DarkTheme\favorite_159.png" />
<Content Include="Assets\Icons\DarkTheme\fish_159.png" />
<Content Include="Assets\Icons\DarkTheme\frei_159.png" />
<Content Include="Assets\Icons\DarkTheme\info_159.png" />
<Content Include="Assets\Icons\DarkTheme\lab_159.png" />
<Content Include="Assets\Icons\DarkTheme\lamb_159.png" />
<Content Include="Assets\Icons\DarkTheme\lecture_159.png" />
<Content Include="Assets\Icons\DarkTheme\person_159.png" />
<Content Include="Assets\Icons\DarkTheme\phone_159.png" />
<Content Include="Assets\Icons\DarkTheme\placeinfo_159.png" />
<Content Include="Assets\Icons\DarkTheme\pork_159.png" />
<Content Include="Assets\Icons\DarkTheme\practise_159.png" />
<Content Include="Assets\Icons\DarkTheme\search_place_159.png" />
<Content Include="Assets\Icons\DarkTheme\seminar_159.png" />
<Content Include="Assets\Icons\DarkTheme\steak_159.png" />
<Content Include="Assets\Icons\DarkTheme\update_159.png" />
<Content Include="Assets\Icons\DarkTheme\wild dish_159.png" />
<Content Include="Assets\Icons\LightTheme\add_159.png" />
<Content Include="Assets\Icons\LightTheme\add_contact_159.png" />
<Content Include="Assets\Icons\LightTheme\btulogo_159.png" />
<Content Include="Assets\Icons\LightTheme\campus_159.png" />
<Content Include="Assets\Icons\DarkTheme\departments_159.png" />
<Content Include="Assets\Icons\LightTheme\carotte_159.png" />
<Content Include="Assets\Icons\LightTheme\chicken_159.png" />
<Content Include="Assets\Icons\LightTheme\current_position_159.png" />
<Content Include="Assets\Icons\LightTheme\delete_159.png" />
<Content Include="Assets\Icons\LightTheme\departments_159.png" />
<Content Include="Assets\Icons\DarkTheme\homework_159.png" />
<Content Include="Assets\Icons\LightTheme\exams_159.png" />
<Content Include="Assets\Icons\LightTheme\favorite_159.png" />
<Content Include="Assets\Icons\LightTheme\fish_159.png" />
<Content Include="Assets\Icons\LightTheme\frei_159.png" />
<Content Include="Assets\Icons\LightTheme\homework_159.png" />
<Content Include="Assets\Icons\DarkTheme\link_159.png" />
<Content Include="Assets\Icons\LightTheme\info_159.png" />
<Content Include="Assets\Icons\LightTheme\lab_159.png" />
<Content Include="Assets\Icons\LightTheme\lamb_159.png" />
<Content Include="Assets\Icons\LightTheme\lecture_159.png" />
<Content Include="Assets\Icons\LightTheme\link_159.png" />
<Content Include="Assets\Icons\DarkTheme\lectures_159.png" />
@@ -471,6 +480,8 @@
<Content Include="Assets\Icons\DarkTheme\schedule_159.png" />
<Content Include="Assets\Icons\LightTheme\person_159.png" />
<Content Include="Assets\Icons\LightTheme\phone_159.png" />
<Content Include="Assets\Icons\LightTheme\placeinfo_159.png" />
<Content Include="Assets\Icons\LightTheme\pork_159.png" />
<Content Include="Assets\Icons\LightTheme\practise_159.png" />
<Content Include="Assets\Icons\LightTheme\schedule_159.png" />
<Content Include="Assets\Icons\DarkTheme\search_159.png" />
@@ -478,10 +489,15 @@
<Content Include="Assets\Icons\DarkTheme\student_council_159.png" />
<Content Include="Assets\Icons\LightTheme\search_place_159.png" />
<Content Include="Assets\Icons\LightTheme\seminar_159.png" />
<Content Include="Assets\Icons\LightTheme\steak_159.png" />
<Content Include="Assets\Icons\LightTheme\student_council_159.png" />
<Content Include="Assets\Icons\DarkTheme\webmail_159.png" />
<Content Include="Assets\Icons\LightTheme\update_159.png" />
<Content Include="Assets\Icons\LightTheme\webmail_159.png" />
<Content Include="Assets\Icons\LightTheme\wild dish_159.png" />
<Content Include="Assets\Lens.Screen-720p.png" />
<Content Include="Assets\Lens.Screen-WVGA.png" />
<Content Include="Assets\Lens.Screen-WXGA.png" />
<Content Include="Assets\testmap.png" />
<Content Include="Assets\Tiles\FlipCycleTileLarge.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -519,8 +535,8 @@
</EmbeddedResource>
<EmbeddedResource Include="Resources\Constants.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Constants.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
<LastGenOutput>Constants1.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Resources\Icons.resx">
<SubType>Designer</SubType>

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

File diff suppressed because it is too large Load Diff

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);
@@ -45,11 +45,12 @@ namespace CampusAppWP8.File.Exams
/// <summary>Executes the file operation.</summary>
/// <remarks>Stubbfel, 03.09.2013.</remarks>
#pragma warning disable 4014
public async void LaunchFile()
{
if (this.storageFile == null)
{
this.storageFile = await this.file.AsStorageFile();
this.storageFile = await this.File.AsStorageFile();
}
if (this.storageFile != null)
@@ -65,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);
@@ -51,7 +51,7 @@ namespace CampusAppWP8.File.Places
/// <summary>
/// Method load OfflineMap as Fallback
/// </summary>
private void FallBackLoad()
public void FallBackLoad()
{
SpsModel fallBackModel = XmlManager.DeserializationFileToModel<SpsModel>(Constants.FileMap_OfflineMap);
this.Model = fallBackModel;

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

@@ -2,7 +2,7 @@
// <copyright file="CBMainMapModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>fiedlchr</author>
// <author>stubbfel</author>
// <sience>13.08.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.Campusmap
@@ -11,21 +11,17 @@ namespace CampusAppWP8.Model.Campusmap
using CampusAppWP8.File.Places;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Resources;
using System.Collections.Generic;
/// <summary>
/// Class for the MapModel of the mainCampus of cottbus
/// </summary>
public class CBMainMapModel : MapModel
public class CBMainMapModel : CampusMapModel
{
#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();
/// <summary>
/// Variable for the PlaceFile
/// </summary>
private PlacesFile file;
private static readonly string Campus = ((int)CampusAppWPortalLib8.Model.Settings.Campus.CB_MAIN).ToString();
#endregion
@@ -34,7 +30,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary>
/// Initializes a new instance of the <see cref="CBMainMapModel" /> class.
/// </summary>
public CBMainMapModel()
public CBMainMapModel(List<PlaceModel> placeList) : base (placeList,CBMainMapModel.Campus)
{
this.ImageSource = Constants.FileMap_CBMainMap;
this.ImageWidth = 2000;
@@ -50,37 +46,7 @@ namespace CampusAppWP8.Model.Campusmap
#endregion
#region Method
/// <summary>Loads the spatial./.</summary>
/// <remarks>Stubbfel, 19.08.2013.</remarks>
protected override void LoadSpatials()
{
if (this.file == null)
{
this.file = new PlacesFile();
}
this.file.OnLoaded += new PlacesFile.OnIO(this.FileIsReady);
this.file.LoadData();
}
/// <summary>
/// Method is called if the PlaceFile is loaded
/// </summary>
private void FileIsReady()
{
SpsModel model = this.file.Model;
this.Spatial = new SpsModel();
foreach (PlaceModel place in model.Places)
{
if (Campus.Equals(place.ParentId) || Campus.Equals(place.PlaceId))
{
this.Spatial.Places.Add(place);
}
}
}
#region Method
#endregion
}

View File

@@ -0,0 +1,67 @@
//-----------------------------------------------------------------------
// <copyright file="CampusMapModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>26.09.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Campusmap
{
using System.Collections.Generic;
using CampusAppWP8.Model.GeoDb;
/// <summary>
/// Class for the CampusMapModel
/// </summary>
public class CampusMapModel : MapModel
{
#region constructor
/// <summary>
/// Initializes a new instance of the <see cref="CampusMapModel" /> class.
/// </summary>
/// <param name="placeList">list of places</param>
/// <param name="campusId">id of the campus</param>
public CampusMapModel(List<PlaceModel> placeList, string campusId)
{
this.CampusId = campusId;
this.LoadSpatials(placeList);
this.IsReady = true;
}
#endregion
#region property
/// <summary>
/// Gets or sets the campusId
/// </summary>
public string CampusId { get; protected set; }
#endregion
#region method
/// <summary>Loads the spatial./.</summary>
/// <remarks>Stubbfel, 19.08.2013.</remarks>
/// <param name="placeList">list of places</param>
protected override void LoadSpatials(List<PlaceModel> placeList)
{
List<PlaceModel> campusPlaces = new List<PlaceModel>();
this.Spatial = new SpsModel();
foreach (PlaceModel place in placeList)
{
if (place.ParentId.Equals(this.CampusId) || place.PlaceId.Equals(this.CampusId))
{
campusPlaces.Add(place);
}
}
this.Spatial.AddPlaces(campusPlaces);
}
#endregion
}
}

View File

@@ -0,0 +1,47 @@
//-----------------------------------------------------------------------
// <copyright file="ClickAblePlacePinModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>26.09.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Campusmap
{
using System.Collections.Generic;
using CampusAppWP8.Model.GeoDb;
/// <summary>
/// abstract class for click abel bins
/// </summary>
public abstract class ClickAblePlacePinModel : MapPinModel
{
#region property
/// <summary>
/// Gets or sets Callback Function, to show place information of the Pin
/// </summary>
public MapModel.MapInfos CallBack { get; set; }
/// <summary>
/// Gets or sets place which are associative with this pin
/// </summary>
public List<PlaceModel> AssocPlaces { get; set; }
#endregion
#region Method
/// <summary>
/// Show Information of this pin places
/// </summary>
/// <param name="sender">sender of the Event</param>
/// <param name="e">MouseButtonEvent Arguments</param>
public void ShowInfo(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
this.CallBack(this.AssocPlaces);
}
#endregion
}
}

View File

@@ -26,6 +26,8 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageHeight = 60;
this.PinImageOffsetX = -25;
this.PinImageOffsetY = -34;
this.Tag = MapPinModel.CurrendPositionPlacePinString;
this.ZIndex = 2;
}
#endregion

View File

@@ -11,5 +11,13 @@ namespace CampusAppWP8.Model.Campusmap
/// <remarks>Stubbfel, 27.08.2013.</remarks>
public class HiddenPinPlaceModel : MapPinModel
{
/// <summary>
/// Initializes a new instance of the <see cref="HiddenPinPlaceModel" /> class.
/// </summary>
public HiddenPinPlaceModel()
{
this.Tag = MapPinModel.HiddenPlacePinString;
this.ZIndex = 0;
}
}
}

View File

@@ -0,0 +1,36 @@
//-----------------------------------------------------------------------
// <copyright file="InfoPlacePinModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>27.08.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWP8.Model.Campusmap
{
using CampusAppWP8.Resources;
/// <summary>Search pin place model.</summary>
/// <remarks>Stubbfel, 27.08.2013.</remarks>
public class InfoPlacePinModel : ClickAblePlacePinModel
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="InfoPlacePinModel" /> class.
/// </summary>
/// <remarks>Stubbfel, 27.08.2013.</remarks>
public InfoPlacePinModel()
{
this.ImageSource = Icons.PlaceInfo;
this.ImageWidth = 60;
this.ImageHeight = 60;
this.PinImageOffsetX = -25;
this.PinImageOffsetY = -27;
this.Tag = MapPinModel.PinTypeToString(PinType.InfoPlace);
this.ZIndex = 1;
}
#endregion
}
}

View File

@@ -27,7 +27,18 @@ namespace CampusAppWP8.Model.Campusmap
/// </summary>
public MapModel()
{
this.LoadSpatials();
this.IsReady = false;
}
/// <summary>
/// Initializes a new instance of the <see cref="MapModel" /> class.
/// </summary>
/// <param name="placeList">list of places</param>
public MapModel(List<PlaceModel> placeList)
{
this.IsReady = false;
this.LoadSpatials(placeList);
this.IsReady = true;
}
#endregion
@@ -48,6 +59,11 @@ namespace CampusAppWP8.Model.Campusmap
#endregion
#region Property
/// <summary>
/// Gets or sets a value indicating whether the map is ready or not
/// </summary>
public bool IsReady { get; protected set; }
/// <summary>
/// Gets or sets the ImageSource of the map
/// </summary>
@@ -195,6 +211,7 @@ namespace CampusAppWP8.Model.Campusmap
Canvas.SetTop(pinImg, pin.Position.Y);
Canvas.SetLeft(pinImg, pin.Position.X);
Canvas.SetZIndex(pinImg, pin.ZIndex);
return pinImg;
}
@@ -246,8 +263,11 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary>Loads the spatial./</summary>
/// <remarks>Stubbfel, 19.08.2013.</remarks>
protected virtual void LoadSpatials()
/// <param name="placeList">list of places</param>
protected virtual void LoadSpatials(List<PlaceModel> placeList)
{
this.Spatial = new SpsModel();
this.Spatial.AddPlaces(placeList);
}
#endregion
@@ -275,11 +295,19 @@ namespace CampusAppWP8.Model.Campusmap
((SearchPlacePinModel)pin).AssocPlaces = places;
((SearchPlacePinModel)pin).CallBack = this.ShowMapInfos;
break;
case MapPinModel.PinType.InfoPlace:
pin = new InfoPlacePinModel();
pinImg.MouseLeftButtonDown += new MouseButtonEventHandler(((InfoPlacePinModel)pin).ShowInfo);
((InfoPlacePinModel)pin).AssocPlaces = places;
((InfoPlacePinModel)pin).CallBack = this.ShowMapInfos;
break;
default:
pin = new HiddenPinPlaceModel();
break;
}
pinImg.Tag = pin.Tag;
return pin;
}

View File

@@ -9,6 +9,7 @@ namespace CampusAppWP8.Model.Campusmap
{
using System.Windows;
using System.Windows.Input;
using CampusAppWP8.Resources;
/// <summary>
/// This Class manage the properties of a MapPin
@@ -17,6 +18,26 @@ namespace CampusAppWP8.Model.Campusmap
{
#region Member
/// <summary>
/// String for info pins
/// </summary>
private static string infoPlacePinString = MapPinModel.PinTypeToString(PinType.InfoPlace);
/// <summary>
/// String for hidden pins
/// </summary>
private static string hiddenPlacePinString = MapPinModel.PinTypeToString(PinType.Hidden);
/// <summary>
/// String for search pins
/// </summary>
private static string searchPlacePinString = MapPinModel.PinTypeToString(PinType.SearchPlace);
/// <summary>
/// String for current position pins
/// </summary>
private static string currendPositionPlacePinString = MapPinModel.PinTypeToString(PinType.CurrentPosition);
/// <summary>
/// Variable of the actual position of the pin
/// </summary>
@@ -46,12 +67,47 @@ namespace CampusAppWP8.Model.Campusmap
SearchPlace = 1,
/// <summary>An enum constant representing the current position option.</summary>
CurrentPosition = 2
CurrentPosition = 2,
/// <summary>An enum constant representing the info place option.</summary>
InfoPlace = 3
}
#endregion
#region Property
/// <summary>
/// Gets the string of current position pins
/// </summary>
public static string CurrendPositionPlacePinString
{
get { return MapPinModel.currendPositionPlacePinString; }
}
/// <summary>
/// Gets the string of search pins
/// </summary>
public static string SearchPlacePinString
{
get { return MapPinModel.searchPlacePinString; }
}
/// <summary>
/// Gets the string of hidden pins
/// </summary>
public static string HiddenPlacePinString
{
get { return MapPinModel.hiddenPlacePinString; }
}
/// <summary>
/// Gets the string of info pins
/// </summary>
public static string InfoPlacePinString
{
get { return MapPinModel.infoPlacePinString; }
}
/// <summary>
/// Gets or sets the ImageSource of the pin
/// </summary>
@@ -67,6 +123,11 @@ namespace CampusAppWP8.Model.Campusmap
/// </summary>
public double ImageHeight { get; set; }
/// <summary>
/// Gets or sets the ZIndex of the pin
/// </summary>
public int ZIndex { get; set; }
/// <summary>
/// Gets or sets the ImageOffsetX of the pin
/// </summary>
@@ -114,6 +175,46 @@ namespace CampusAppWP8.Model.Campusmap
}
}
}
/// <summary>
/// Gets or sets the tag of the pin
/// </summary>
public object Tag { get; set; }
#endregion
#region Method
/// <summary>
/// Method convert PinType to a string
/// </summary>
/// <param name="type">type of the Pin</param>
/// <returns>PinType as string</returns>
public static string PinTypeToString(PinType type)
{
string result = null;
switch (type)
{
case PinType.CurrentPosition:
result = Constants.PinType_CurrentPosition;
break;
case PinType.Hidden:
result = Constants.PinType_Hidden;
break;
case PinType.InfoPlace:
result = Constants.PinType_Info;
break;
case PinType.SearchPlace:
result = Constants.PinType_Search;
break;
default:
result = string.Empty;
break;
}
return result;
}
#endregion
}
}

View File

@@ -8,13 +8,11 @@
namespace CampusAppWP8.Model.Campusmap
{
using System.Collections.Generic;
using CampusAppWP8.Model.GeoDb;
using CampusAppWP8.Resources;
/// <summary>Search pin place model.</summary>
/// <remarks>Stubbfel, 27.08.2013.</remarks>
public class SearchPlacePinModel : MapPinModel
public class SearchPlacePinModel : ClickAblePlacePinModel
{
#region Constructor
@@ -29,34 +27,8 @@ namespace CampusAppWP8.Model.Campusmap
this.ImageHeight = 60;
this.PinImageOffsetX = -25;
this.PinImageOffsetY = -27;
}
#endregion
#region property
/// <summary>
/// Gets or sets Callback Function, to show place information of the Pin
/// </summary>
public MapModel.MapInfos CallBack { get; set; }
/// <summary>
/// Gets or sets place which are associative with this pin
/// </summary>
public List<PlaceModel> AssocPlaces { get; set; }
#endregion
#region Method
/// <summary>
/// Show Information of this pin places
/// </summary>
/// <param name="sender">sender of the Event</param>
/// <param name="e">MouseButtonEvent Arguments</param>
public void ShowInfo(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
this.CallBack(this.AssocPlaces);
this.Tag = MapPinModel.SearchPlacePinString;
this.ZIndex = 3;
}
#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

@@ -0,0 +1,57 @@
//-----------------------------------------------------------------------------
// <copyright file="CampusBuildingLayerModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>23.09.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
{
using System.Collections.Generic;
using CampusAppWP8.Resources;
/// <summary>
/// Class is model for buildings of a campus
/// </summary>
public class CampusBuildingLayerModel
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="CampusBuildingLayerModel" /> class.
/// </summary>
/// <param name="layerId">id of the layer</param>
/// <param name="places">list of place which can be room of the layer</param>
public CampusBuildingLayerModel(string layerId, List<PlaceModel> places)
{
this.LayerId = layerId;
this.Rooms = new SpsModel();
foreach (PlaceModel place in places)
{
string placeLayerId = place.GetInformationsValue(Constants.PisInformationName_Layer);
if (placeLayerId != null && placeLayerId.Equals(layerId))
{
this.Rooms.Places.Add(place);
}
}
}
#endregion
#region property
/// <summary>
/// Gets or sets Rooms
/// </summary>
public SpsModel Rooms { get; set; }
/// <summary>
/// Gets or sets LayerId
/// </summary>
public string LayerId { get; set; }
#endregion
}
}

View File

@@ -0,0 +1,96 @@
//-----------------------------------------------------------------------------
// <copyright file="CampusBuildingModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>23.09.2013</sience>
//-----------------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
{
using System.Collections.Generic;
using CampusAppWP8.Resources;
/// <summary>
/// Class is model for buildings of a campus
/// </summary>
public class CampusBuildingModel
{
#region constructor
/// <summary>
/// Initializes a new instance of the <see cref="CampusBuildingModel" /> class.
/// </summary>
/// <param name="buildingId">id of the building</param>
/// <param name="places">list of place which can be room of the buildings</param>
public CampusBuildingModel(string buildingId, List<PlaceModel> places)
{
this.Layers = new Dictionary<string, CampusBuildingLayerModel>();
foreach (PlaceModel place in places)
{
if (place.ParentId.Equals(buildingId))
{
string placeLayerId = place.GetInformationsValue(Constants.PisInformationName_Layer);
if (placeLayerId == null)
{
continue;
}
if (this.Layers.ContainsKey(placeLayerId))
{
this.Layers[placeLayerId].Rooms.Places.Add(place);
}
else
{
this.Layers.Add(placeLayerId, new CampusBuildingLayerModel(placeLayerId, new List<PlaceModel>() { place }));
}
}
else if (place.PlaceId.Equals(buildingId))
{
this.Building = place;
}
}
}
#endregion
#region Property
/// <summary>
/// Gets the Layer of the building
/// </summary>
public Dictionary<string, CampusBuildingLayerModel> Layers { get; private set; }
/// <summary>
/// Gets or sets the Building PlaceModel
/// </summary>
public PlaceModel Building { get; set; }
#endregion
#region method
/// <summary>
/// Method gets a place by their placeID
/// </summary>
/// <param name="placeID">the placeId of the place</param>
/// <returns>The place by identifier.</returns>
public PlaceModel GetPlaceById(string placeID)
{
PlaceModel result = null;
foreach (CampusBuildingLayerModel layer in this.Layers.Values)
{
result = layer.Rooms.GetPlaceById(placeID);
if (result != null)
{
break;
}
}
return result;
}
#endregion
}
}

View File

@@ -87,6 +87,11 @@ namespace CampusAppWP8.Model.GeoDb
[XmlElement("placeService")]
public ObservableCollection<PlaceService> Services { get; set; }
/// <summary>
/// Gets or sets a string, which is the caption of the place (e.g. for contents of UIElements)
/// </summary>
public string Caption { get; set; }
#endregion
#region Method

View File

@@ -169,6 +169,12 @@ namespace CampusAppWP8.Model.GeoDb
public List<PlaceModel> FilterByPid(List<string> pidList)
{
List<PlaceModel> fitlerList = new List<PlaceModel>();
if (pidList == null || pidList.Count < 1)
{
return fitlerList;
}
foreach (PlaceModel place in this.Places)
{
if (pidList.Contains(place.PlaceId))

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
}
}

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