Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
109ad354a3 | ||
|
|
b702b0bfd9 | ||
|
|
710b4c1e07 | ||
|
|
d9838ddc16 | ||
|
|
ca3bd2381f | ||
|
|
6ea8d06a0e | ||
|
|
87fc00071a | ||
|
|
f3d0667310 | ||
|
|
7668450d9c | ||
|
|
dc3c527996 | ||
|
|
80d05b9c45 | ||
|
|
5de000ef17 | ||
|
|
c26344fc40 | ||
|
|
cb3dd94b55 | ||
|
|
71d113f819 | ||
|
|
7b879319b2 | ||
|
|
ca9eab8bd5 | ||
|
|
8527f657fc | ||
|
|
a898477394 | ||
|
|
a0d68f8d3f | ||
|
|
1753954c33 | ||
|
|
ffa91ee8fd | ||
|
|
93c9bbe5d1 | ||
|
|
c89fb9ab79 | ||
|
|
329e5525e3 | ||
|
|
7c43d8cd70 | ||
|
|
496fa63cf3 | ||
|
|
1cd34afb9c | ||
|
|
a8b2d33826 | ||
|
|
8dfb7693ac | ||
|
|
77b30b35c5 | ||
|
|
d565b332e8 | ||
|
|
995edbc32a | ||
|
|
05168211b7 | ||
|
|
1dbd2be23f | ||
|
|
0396a62301 | ||
|
|
dd709f8937 | ||
|
|
5c1891459b | ||
|
|
b075e5bb7e | ||
|
|
750ebe4e22 | ||
|
|
162c7042ae | ||
|
|
85cb54f0e1 | ||
|
|
4047aacf0f | ||
|
|
94c538a429 | ||
|
|
d23c6431f1 | ||
|
|
fc0e7fba64 | ||
|
|
87436ef6e8 | ||
|
|
2f2237eae2 | ||
|
|
e734a750ff | ||
|
|
621aadc9a0 | ||
|
|
7183d6de01 | ||
|
|
771e1fc7b5 | ||
|
|
04ff3ad80b | ||
|
|
e1b6a2d279 |
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 483 B |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/carotte_159.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/chicken_159.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/fish_159.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/frei_159.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/lamb_159.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/pork_159.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 2.1 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/DarkTheme/steak_159.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 979 B After Width: | Height: | Size: 979 B |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 469 B |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 864 B |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/fish_159.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/frei_159.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/lamb_159.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/pork_159.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Icons/LightTheme/steak_159.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Lens.Screen-720p.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Lens.Screen-WVGA.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
CampusAppWP8/CampusAppWP8/Assets/Lens.Screen-WXGA.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -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>
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace CampusAppWP8.Feed.Events
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWPortalLib8.Model.RSS;
|
||||
using CampusAppWPortalLib8.Model;
|
||||
|
||||
/// <summary>
|
||||
/// Event Feed.
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace CampusAppWP8.Feed.News
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWPortalLib8.Model.RSS;
|
||||
using CampusAppWPortalLib8.Model;
|
||||
|
||||
/// <summary>
|
||||
/// News Feed.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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[]>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
67
CampusAppWP8/CampusAppWP8/Model/Campusmap/CampusMapModel.cs
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
18
CampusAppWP8/CampusAppWP8/Model/Exams/ExamListWp8Model.cs
Normal 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>
|
||||
{
|
||||
}
|
||||
}
|
||||
30
CampusAppWP8/CampusAppWP8/Model/Exams/ExamWp8Model.cs
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
96
CampusAppWP8/CampusAppWP8/Model/GeoDb/CampusBuildingModel.cs
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
34
CampusAppWP8/CampusAppWP8/Model/Lecture/LectureWp8List.cs
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||