Merge branch 'develop' into feature/#173
@@ -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 |
@@ -112,12 +112,17 @@
|
||||
<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\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" />
|
||||
@@ -203,6 +208,9 @@
|
||||
<Compile Include="Utility\ICSProperties\UniqueID.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Url.cs" />
|
||||
<Compile Include="Utility\ICSProperties\Version.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>
|
||||
@@ -215,6 +223,12 @@
|
||||
<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" />
|
||||
@@ -334,11 +348,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" />
|
||||
@@ -366,6 +375,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>
|
||||
@@ -522,34 +535,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" />
|
||||
@@ -563,6 +590,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" />
|
||||
@@ -570,10 +599,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>
|
||||
@@ -611,8 +645,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>
|
||||
|
||||
@@ -45,6 +45,7 @@ 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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,22 +11,18 @@ 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;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -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 (place.PlaceId.StartsWith(CBMainMapModel.Campus))
|
||||
{
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace CampusAppWP8.Model.Lecture
|
||||
}
|
||||
else if (typeStr.Contains(LectureActivity.ActivityIconNameSeminar))
|
||||
{
|
||||
this.iconUrl = Icons.Info;
|
||||
this.iconUrl = Icons.Seminar;
|
||||
}
|
||||
else if (typeStr.Contains(LectureActivity.ActivityIconNameLab))
|
||||
{
|
||||
|
||||
@@ -109,6 +109,21 @@ namespace CampusAppWP8.Model.Setting
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DeploymentNumber of the app
|
||||
/// </summary>
|
||||
public int DeploymentNumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return App.LoadFromAppState<int>(Constants.AppSetting_DeploymentNumber);
|
||||
}
|
||||
set
|
||||
{
|
||||
App.SaveToAppState<int>(Constants.AppSetting_DeploymentNumber,value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -39,21 +39,10 @@
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<!-- <StackPanel Grid.Column="0">
|
||||
<TextBlock Text="Lat:" />
|
||||
<TextBox Name="YPoint" Text="51,767747" InputScope="Number" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock Text="Long:" />
|
||||
<TextBox Name="XPoint" Text="14,327545" InputScope="Number" />
|
||||
</StackPanel>
|
||||
<Button Grid.Column="2" Click="Button_Click">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="60"/>
|
||||
</Button>-->
|
||||
<StackPanel Grid.Column="0" VerticalAlignment="Center">
|
||||
<TextBox Name="QString" InputScope="Text" AcceptsReturn="False" />
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" Click="Button_Click2">
|
||||
<Button Grid.Column="1" Click="SearchByText">
|
||||
<Image Source="{Binding Path=ThemelizedIcon.Search, Source={StaticResource ThemelizedIcons}}" Width="60"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
@@ -74,6 +63,7 @@
|
||||
<shell:ApplicationBar.MenuItems>
|
||||
<shell:ApplicationBarMenuItem Text="Scan QR-Code" Click="SearchPlaceByQR_Click" />
|
||||
<shell:ApplicationBarMenuItem Text="Scan NFC-Tag" Click="SearchPlaceByNFC_Click"/>
|
||||
<shell:ApplicationBarMenuItem Text="Gebäudeinfos einblenden" Click="ShowBuildingsInformation" />
|
||||
</shell:ApplicationBar.MenuItems>
|
||||
</shell:ApplicationBar>
|
||||
</phone:PhoneApplicationPage.ApplicationBar>
|
||||
|
||||
@@ -11,10 +11,13 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
using System.Collections.Generic;
|
||||
using System.Device.Location;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.File.Places;
|
||||
using CampusAppWP8.Model.Campusmap;
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
using CampusAppWP8.Resources;
|
||||
@@ -35,7 +38,12 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
private readonly ProximityDevice device = ProximityDevice.GetDefault();
|
||||
|
||||
/// <summary>Variable for the map model.</summary>
|
||||
private MapModel map;
|
||||
private CampusMapModel campusMap;
|
||||
|
||||
/// <summary>
|
||||
/// Variable for the PlaceFile
|
||||
/// </summary>
|
||||
private PlacesFile file;
|
||||
|
||||
/// <summary>
|
||||
/// List of information names
|
||||
@@ -47,6 +55,16 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// </summary>
|
||||
private bool qrcodeScan = false;
|
||||
|
||||
/// <summary>
|
||||
/// Variable for the last query
|
||||
/// </summary>
|
||||
private string lastQuery;
|
||||
|
||||
/// <summary>
|
||||
/// Flag which indicates the map show information of all buildings
|
||||
/// </summary>
|
||||
private bool buildInfoEnable;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -56,12 +74,10 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
public CampusMapPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.map = new CBMainMapModel();
|
||||
this.MapCanvas.DataContext = this.map;
|
||||
this.map.ShowMapInfos += new CBMainMapModel.MapInfos(this.ShowMapInfo);
|
||||
|
||||
ApplicationBarMenuItem menuItem1 = ApplicationBar.MenuItems[0] as ApplicationBarMenuItem;
|
||||
ApplicationBarMenuItem menuItem2 = ApplicationBar.MenuItems[1] as ApplicationBarMenuItem;
|
||||
ApplicationBarMenuItem menuItem3 = ApplicationBar.MenuItems[2] as ApplicationBarMenuItem;
|
||||
|
||||
if (menuItem1 != null)
|
||||
{
|
||||
@@ -72,10 +88,37 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
{
|
||||
menuItem2.Text = AppResources.CampusMapApp_ScanNfc;
|
||||
}
|
||||
|
||||
if (menuItem3 != null)
|
||||
{
|
||||
menuItem3.Text = AppResources.CampusMapApp_EnableBuildInfo;
|
||||
}
|
||||
|
||||
if (this.file == null)
|
||||
{
|
||||
this.file = new PlacesFile();
|
||||
}
|
||||
|
||||
this.file.OnLoaded += new PlacesFile.OnIO(this.FileIsReady);
|
||||
this.file.LoadData();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
/// <summary>
|
||||
/// Delegate for LoadingPlace events
|
||||
/// </summary>
|
||||
/// <param name="args">the events args</param>
|
||||
public delegate void LoadingPlace(string args);
|
||||
|
||||
/// <summary>
|
||||
/// Event for loading places
|
||||
/// </summary>
|
||||
public event LoadingPlace OnLoadingPlace;
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region protected
|
||||
@@ -86,26 +129,22 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
if (this.map.Spatial == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.NavigationMode == NavigationMode.New)
|
||||
{
|
||||
MapCanvas.Children.Clear();
|
||||
this.ClearMap();
|
||||
|
||||
bool scroll = true;
|
||||
string alias = "campus";
|
||||
|
||||
if (NavigationContext.QueryString.ContainsKey(Constants.ParamModelMap_SearchTermAlias))
|
||||
{
|
||||
alias = NavigationContext.QueryString[Constants.ParamModelMap_SearchTermAlias];
|
||||
this.AddPins(this.SearchPlaces(alias), MapPinModel.PinType.SearchPlace);
|
||||
string alias = NavigationContext.QueryString[Constants.ParamModelMap_SearchTermAlias];
|
||||
this.ShowPlacesByQueryAsSearchPin(alias);
|
||||
scroll = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AddPins(this.SearchPlaces(alias), MapPinModel.PinType.Hidden);
|
||||
this.ShowPlacesByQueryAsHiddenPin("campus");
|
||||
}
|
||||
|
||||
this.ShowCurrentPositionDispatcher(scroll);
|
||||
@@ -119,7 +158,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
string searchPid = Wp8StringManager.FilterPlaceIdinQRResultString(qrcodeResult);
|
||||
if (searchPid != null)
|
||||
{
|
||||
this.AddPinsByPids(new List<string>() { searchPid }, MapPinModel.PinType.SearchPlace);
|
||||
this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,18 +167,242 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
|
||||
#region private
|
||||
|
||||
/// <summary>
|
||||
/// Method set the lastQuery and register to OnLoadingPlace-Event
|
||||
/// </summary>
|
||||
/// <param name="query">the query string</param>
|
||||
/// <param name="action">the event callback</param>
|
||||
private void SetLastQuery(string query, Action<string> action)
|
||||
{
|
||||
this.lastQuery = query;
|
||||
this.OnLoadingPlace = new CampusMapPage.LoadingPlace(action);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method shows certain places as hidden Pin
|
||||
/// </summary>
|
||||
/// <param name="query">the query string</param>
|
||||
private void ShowPlacesByQueryAsHiddenPin(string query)
|
||||
{
|
||||
if (!this.IsMapReady())
|
||||
{
|
||||
this.SetLastQuery(query, this.ShowPlacesByQueryAsHiddenPin);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ShowPlacesByQuery(query, MapPinModel.PinType.Hidden, false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method shows certain places as search Pin
|
||||
/// </summary>
|
||||
/// <param name="query">the query string</param>
|
||||
private void ShowPlacesByQueryAsSearchPin(string query)
|
||||
{
|
||||
if (!this.IsMapReady())
|
||||
{
|
||||
this.SetLastQuery(query, this.ShowPlacesByQueryAsSearchPin);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool allPlaces = false;
|
||||
if (Wp8StringManager.IsDigitsOnly(query))
|
||||
{
|
||||
allPlaces = true;
|
||||
}
|
||||
|
||||
this.ShowPlacesByQuery(query, MapPinModel.PinType.SearchPlace, allPlaces);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method show all places, which match with the query as a pin
|
||||
/// </summary>
|
||||
/// <param name="query">the query string</param>
|
||||
/// <param name="pintype">the type of the pin</param>
|
||||
/// <param name="allPlaces">if its true then send query to the place file otherwise to the CampusMapModel</param>
|
||||
private void ShowPlacesByQuery(string query, MapPinModel.PinType pintype, bool allPlaces)
|
||||
{
|
||||
this.AddPins(this.SearchPlaces(query, allPlaces), pintype);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method show all places by placeId
|
||||
/// </summary>
|
||||
/// <param name="placeId">the placeId</param>
|
||||
/// <param name="pintype">the type of the pin</param>
|
||||
/// <param name="allPlaces">if its true then send query to the place file otherwise to the CampusMapModel</param>
|
||||
private void ShowPlacesByPlaceId(string placeId, MapPinModel.PinType pintype, bool allPlaces)
|
||||
{
|
||||
this.AddPinsByPids(new List<string>() { placeId }, pintype, false, allPlaces);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method shows places by placeId from place file as search Pin
|
||||
/// </summary>
|
||||
/// <param name="placeId">the placeId</param>
|
||||
private void ShowAllPlacesByPlaceIdAsSearchPin(string placeId)
|
||||
{
|
||||
if (!this.IsMapReady())
|
||||
{
|
||||
this.SetLastQuery(placeId, this.ShowAllPlacesByPlaceIdAsSearchPin);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ShowPlacesByPlaceId(placeId, MapPinModel.PinType.SearchPlace, true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method shows places by placeId from CampusMapModel as search Pin
|
||||
/// </summary>
|
||||
/// <param name="placeId">the placeId</param>
|
||||
private void ShowPlacesByPlaceIdAsSearchPin(string placeId)
|
||||
{
|
||||
if (!this.IsMapReady())
|
||||
{
|
||||
this.SetLastQuery(placeId, this.ShowPlacesByPlaceIdAsSearchPin);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ShowPlacesByPlaceId(placeId, MapPinModel.PinType.SearchPlace, false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method show all buildings of a campus
|
||||
/// </summary>
|
||||
/// <param name="campusId">the id of the campus</param>
|
||||
private void ShowAllCampusBuilding(string campusId)
|
||||
{
|
||||
if (!this.IsMapReady())
|
||||
{
|
||||
this.SetLastQuery(campusId, this.ShowAllCampusBuilding);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AddPins(this.campusMap.Spatial.Places.ToList(), MapPinModel.PinType.InfoPlace, false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method check if the map loading is finish
|
||||
/// </summary>
|
||||
/// <returns>true, if the map is ready to use, otherwise false</returns>
|
||||
private bool IsMapReady()
|
||||
{
|
||||
if (this.campusMap == null || !this.campusMap.IsReady)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method will be execute if the place file is ready
|
||||
/// </summary>
|
||||
private void FileIsReady()
|
||||
{
|
||||
this.campusMap = new CBMainMapModel(this.file.Model.Places.ToList());
|
||||
this.MapCanvas.DataContext = this.campusMap;
|
||||
this.campusMap.ShowMapInfos += new CBMainMapModel.MapInfos(this.ShowMapInfo);
|
||||
if (this.OnLoadingPlace != null)
|
||||
{
|
||||
this.OnLoadingPlace(this.lastQuery);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>TextSearch click method.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="sender">caller object.</param>
|
||||
/// <param name="e"> some EventArgs.</param>
|
||||
private void SearchByText(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string query = QString.Text.Trim();
|
||||
|
||||
if (query.Equals(string.Empty))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.ClearMap(new List<string>() { MapPinModel.SearchPlacePinString });
|
||||
this.ShowPlacesByQueryAsSearchPin(query);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method insert or remove the buildings pins
|
||||
/// </summary>
|
||||
/// <param name="sender">caller object.</param>
|
||||
/// <param name="e"> some EventArgs.</param>
|
||||
private void ShowBuildingsInformation(object sender, EventArgs e)
|
||||
{
|
||||
string menuText;
|
||||
if (!this.buildInfoEnable)
|
||||
{
|
||||
this.ShowAllCampusBuilding(string.Empty);
|
||||
this.buildInfoEnable = true;
|
||||
menuText = AppResources.CampusMapApp_DisableBuildInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClearMap(new List<string>() { MapPinModel.InfoPlacePinString });
|
||||
this.buildInfoEnable = false;
|
||||
menuText = AppResources.CampusMapApp_EnableBuildInfo;
|
||||
}
|
||||
|
||||
ApplicationBarMenuItem item = ApplicationBar.MenuItems[2] as ApplicationBarMenuItem;
|
||||
item.Text = menuText;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method clear the Map
|
||||
/// </summary>
|
||||
/// <param name="removeTags">(optional) tags of the UIElement</param>
|
||||
private void ClearMap(List<string> removeTags = null)
|
||||
{
|
||||
if (removeTags == null)
|
||||
{
|
||||
MapCanvas.Children.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
List<UIElement> childs = MapCanvas.Children.ToList();
|
||||
foreach (UIElement child in childs)
|
||||
{
|
||||
Image childImg = child as Image;
|
||||
if (childImg == null || childImg.Tag == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string imgTag = childImg.Tag.ToString().Trim();
|
||||
if (removeTags.Contains(imgTag))
|
||||
{
|
||||
MapCanvas.Children.Remove(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method adds pin to the map by given list of placeId
|
||||
/// </summary>
|
||||
/// <param name="pidList">list of placeId</param>
|
||||
/// <param name="pinType">type of pin</param>
|
||||
/// <param name="clearCanvas">(optional) if its true, clear canvas before adding</param>
|
||||
private void AddPinsByPids(List<string> pidList, MapPinModel.PinType pinType, bool clearCanvas = true)
|
||||
/// <param name="allPlaces">(optional) if its true, load place from place file, otherwise from CampusMapModel</param>
|
||||
private void AddPinsByPids(List<string> pidList, MapPinModel.PinType pinType, bool clearCanvas = true, bool allPlaces = false)
|
||||
{
|
||||
// clear canvas
|
||||
if (clearCanvas)
|
||||
{
|
||||
MapCanvas.Children.Clear();
|
||||
this.ClearMap();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClearMap(new List<string>() { MapPinModel.PinTypeToString(pinType) });
|
||||
}
|
||||
|
||||
// null and empty list assert
|
||||
@@ -150,16 +413,25 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
|
||||
List<PlaceModel> placeList = new List<PlaceModel>();
|
||||
PlaceModel tmpPlace;
|
||||
SpsModel spatial;
|
||||
if (allPlaces)
|
||||
{
|
||||
spatial = this.file.Model;
|
||||
}
|
||||
else
|
||||
{
|
||||
spatial = this.campusMap.Spatial;
|
||||
}
|
||||
|
||||
foreach (string pid in pidList)
|
||||
{
|
||||
tmpPlace = this.map.Spatial.GetPlaceById(pid);
|
||||
tmpPlace = spatial.GetPlaceById(pid);
|
||||
if (tmpPlace != null)
|
||||
{
|
||||
placeList.Add(tmpPlace);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// add pins to map
|
||||
if (placeList.Count > 0)
|
||||
{
|
||||
@@ -167,15 +439,6 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Button click method.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="sender">caller object.</param>
|
||||
/// <param name="e"> some EventArgs.</param>
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// this.AddPin(double.Parse(XPoint.Text), double.Parse(YPoint.Text));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method start a NFCScan
|
||||
/// </summary>
|
||||
@@ -185,7 +448,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
{
|
||||
MessageBoxes.ShowMainModelInfoMessageBox(AppResources.ScarNfc_Search);
|
||||
this.ProgressBar.Visibility = Visibility.Visible;
|
||||
this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
|
||||
long id = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -223,11 +486,11 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
// add pins to map
|
||||
if (this.Dispatcher != null)
|
||||
{
|
||||
this.Dispatcher.BeginInvoke(new Action(() => this.AddPinsByPids(new List<string>() { searchPid }, MapPinModel.PinType.SearchPlace)));
|
||||
this.Dispatcher.BeginInvoke(new Action(() => this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid)));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AddPinsByPids(new List<string>() { searchPid }, MapPinModel.PinType.SearchPlace);
|
||||
this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -236,8 +499,8 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
if (this.Dispatcher != null)
|
||||
{
|
||||
this.Dispatcher.BeginInvoke(new Action(() => MessageBoxes.ShowMainModelErrorMessageBox(AppResources.ScarNfc_Fail)));
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxes.ShowMainModelErrorMessageBox(AppResources.ScarNfc_Fail);
|
||||
}
|
||||
@@ -246,36 +509,36 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
if (this.Dispatcher != null)
|
||||
{
|
||||
this.Dispatcher.BeginInvoke(new Action(() => this.ProgressBar.Visibility = Visibility.Collapsed));
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ProgressBar.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Button click method.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="sender">caller object.</param>
|
||||
/// <param name="e"> some EventArgs.</param>
|
||||
private void Button_Click2(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string query = QString.Text.Trim();
|
||||
|
||||
if (query.Equals(string.Empty))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MapCanvas.Children.Clear();
|
||||
this.AddPins(this.SearchPlaces(query), MapPinModel.PinType.SearchPlace);
|
||||
}
|
||||
|
||||
/// <summary>Searches for the first places.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="query">The query.</param>
|
||||
/// <param name="allPlaces">(optional) if its true, search places in place file, otherwise in CampusMapModel</param>
|
||||
/// <returns>The found places.</returns>
|
||||
private List<PlaceModel> SearchPlaces(string query)
|
||||
private List<PlaceModel> SearchPlaces(string query, bool allPlaces = false)
|
||||
{
|
||||
SpsModel spatial;
|
||||
if (allPlaces)
|
||||
{
|
||||
spatial = this.file.Model;
|
||||
}
|
||||
else
|
||||
{
|
||||
spatial = this.campusMap.Spatial;
|
||||
}
|
||||
|
||||
// if query is an id
|
||||
if (Wp8StringManager.IsDigitsOnly(query))
|
||||
{
|
||||
return new List<PlaceModel>() { spatial.GetPlaceById(query) };
|
||||
}
|
||||
|
||||
if (this.informationsNames == null)
|
||||
{
|
||||
this.informationsNames = new List<string>();
|
||||
@@ -284,7 +547,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
this.informationsNames.Add(Constants.PisInformationName_ShortName);
|
||||
}
|
||||
|
||||
return this.map.Spatial.GetPlacesByInformation(query, true, this.informationsNames);
|
||||
return spatial.GetPlacesByInformation(query, true, this.informationsNames);
|
||||
}
|
||||
|
||||
/// <summary>Adds the pins.</summary>
|
||||
@@ -296,6 +559,11 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
{
|
||||
foreach (PlaceModel place in places)
|
||||
{
|
||||
if (place == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
GeoCoordinate coor = place.GeoRefPoint;
|
||||
if (coor != null)
|
||||
{
|
||||
@@ -315,8 +583,8 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
/// <param name="assocPlaces">(Optional) List of places, whose are associative with the pin</param>
|
||||
private void AddPin(double x, double y, MapPinModel.PinType type, bool scroll = true, List<PlaceModel> assocPlaces = null)
|
||||
{
|
||||
Point scrollPoint = this.map.GetScrollPoint(this.map.ConverToPixelPoint(this.map.ConverToMapPoint(x, y)));
|
||||
MapCanvas.Children.Add(this.map.AddPinFromRefPoint(this.map.ConverToPixelPoint(this.map.ConverToMapPoint(x, y)), type, assocPlaces));
|
||||
Point scrollPoint = this.campusMap.GetScrollPoint(this.campusMap.ConverToPixelPoint(this.campusMap.ConverToMapPoint(x, y)));
|
||||
MapCanvas.Children.Add(this.campusMap.AddPinFromRefPoint(this.campusMap.ConverToPixelPoint(this.campusMap.ConverToMapPoint(x, y)), type, assocPlaces));
|
||||
|
||||
MapScroller.UpdateLayout();
|
||||
if (scroll)
|
||||
@@ -324,9 +592,6 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
MapScroller.ScrollToVerticalOffset(scrollPoint.Y);
|
||||
MapScroller.ScrollToHorizontalOffset(scrollPoint.X);
|
||||
}
|
||||
|
||||
// XPoint.Text = x.ToString();
|
||||
// YPoint.Text = y.ToString();
|
||||
}
|
||||
|
||||
/// <summary>On clicking the update button in the ApplicationBar.</summary>
|
||||
@@ -386,7 +651,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
{
|
||||
string lat = App.LoadFromAppState<string>(Constants.GeoWatch_CurrentPosition_Lat);
|
||||
string log = App.LoadFromAppState<string>(Constants.GeoWatch_CurrentPosition_Long);
|
||||
if (lat.Equals("0") && log.Equals("0"))
|
||||
if (lat == null || log == null ||(lat.Equals("0") && log.Equals("0")))
|
||||
{
|
||||
if (Settings.AppSetting.GeoWatchEnable)
|
||||
{
|
||||
@@ -397,6 +662,7 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClearMap(new List<string>() { MapPinModel.CurrendPositionPlacePinString });
|
||||
this.SetPinToPosition(lat, log, MapPinModel.PinType.CurrentPosition, scroll);
|
||||
}
|
||||
}
|
||||
@@ -432,12 +698,67 @@ namespace CampusAppWP8.Pages.Campusmap
|
||||
msgText += AppResources.PlaceLabel_Name + ": ";
|
||||
msgText += place.GetInformationsValue(Constants.PisInformationName_Name);
|
||||
msgText = Wp8StringManager.AddNewLine(msgText);
|
||||
msgText += AppResources.PlaceLabel_ShortDesc + ": ";
|
||||
msgText += place.GetInformationsValue(Constants.PisInformationName_ShortDesc);
|
||||
msgText = Wp8StringManager.AddNewLine(msgText);
|
||||
|
||||
string type = place.GetInformationsValue(Constants.PisInformationName_Typ);
|
||||
if (type != null)
|
||||
{
|
||||
msgText += AppResources.PlaceLabel_Type + ": ";
|
||||
msgText += type;
|
||||
msgText = Wp8StringManager.AddNewLine(msgText);
|
||||
}
|
||||
|
||||
string shortDesc = place.GetInformationsValue(Constants.PisInformationName_ShortDesc);
|
||||
if (shortDesc != null)
|
||||
{
|
||||
msgText += AppResources.PlaceLabel_ShortDesc + ": ";
|
||||
msgText += shortDesc;
|
||||
msgText = Wp8StringManager.AddNewLine(msgText);
|
||||
}
|
||||
|
||||
string access = place.GetInformationsValue(Constants.PisInformationName_Accesbility);
|
||||
if (access != null)
|
||||
{
|
||||
msgText += AppResources.PlaceLabel_Accessbility + ": ";
|
||||
msgText += access;
|
||||
msgText = Wp8StringManager.AddNewLine(msgText);
|
||||
}
|
||||
}
|
||||
|
||||
MessageBoxes.ShowMainModelInfoMessageBox(msgText);
|
||||
|
||||
foreach (PlaceModel place in places)
|
||||
{
|
||||
if (place.ParentId.Equals(this.campusMap.CampusId) && this.HasRooms(place.PlaceId))
|
||||
{
|
||||
MessageBoxResult msgResult = MessageBoxes.ShowPlaceInfoOkCancelMessageBox(AppResources.MsgBox_ShowRoomList);
|
||||
if (msgResult.Equals(MessageBoxResult.OK))
|
||||
{
|
||||
string urlString = Constants.PathCampusmap_RoomListPage;
|
||||
urlString += "?" + Constants.ParamBuildingId + "=" + place.PlaceId;
|
||||
Uri url = new Uri(urlString as string, UriKind.Relative);
|
||||
this.NavigationService.Navigate(url);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method check if a certain place has some rooms
|
||||
/// </summary>
|
||||
/// <param name="placeId">the place id</param>
|
||||
/// <returns>true, if the place has got rooms, otherwise false</returns>
|
||||
private bool HasRooms(string placeId)
|
||||
{
|
||||
foreach (PlaceModel place in this.file.Model.Places)
|
||||
{
|
||||
if (place.ParentId.Equals(placeId))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
48
CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml
Normal file
@@ -0,0 +1,48 @@
|
||||
<phone:PhoneApplicationPage
|
||||
x:Class="CampusAppWP8.Pages.Campusmap.RoomListPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
|
||||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:lui="clr-namespace:CampusAppWP8.Utility.Lui.Button"
|
||||
mc:Ignorable="d"
|
||||
FontFamily="{StaticResource PhoneFontFamilyNormal}"
|
||||
FontSize="{StaticResource PhoneFontSizeNormal}"
|
||||
Foreground="{StaticResource PhoneForegroundBrush}"
|
||||
SupportedOrientations="Portrait" Orientation="Portrait"
|
||||
shell:SystemTray.IsVisible="True">
|
||||
|
||||
<!--LayoutRoot ist das Stammraster, in dem alle anderen Seiteninhalte platziert werden-->
|
||||
<Grid x:Name="LayoutRoot" Background="Transparent">
|
||||
<!--Pivotsteuerelement-->
|
||||
<phone:Pivot Name="RoomPivot" Title="{Binding LocalizedResources.CampusMapApp_Title, Source={StaticResource LocalizedStrings}}">
|
||||
<phone:Pivot.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Key}" />
|
||||
</DataTemplate>
|
||||
</phone:Pivot.HeaderTemplate>
|
||||
<phone:Pivot.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ListBox ItemsSource="{Binding Value.Rooms.Places}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<lui:GoToMapButton SearchTerm="{Binding PlaceId}" Style="{StaticResource ListButtonStyle}">
|
||||
<TextBlock Text="{Binding Caption}"/>
|
||||
</lui:GoToMapButton>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</DataTemplate>
|
||||
</phone:Pivot.ItemTemplate>
|
||||
</phone:Pivot>
|
||||
</Grid>
|
||||
|
||||
</phone:PhoneApplicationPage>
|
||||
162
CampusAppWP8/CampusAppWP8/Pages/Campusmap/RoomListPage.xaml.cs
Normal file
@@ -0,0 +1,162 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// <copyright file="RoomListPage.xaml.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>23.09.2013</sience>
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Pages.Campusmap
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.File.Places;
|
||||
using CampusAppWP8.Model.GeoDb;
|
||||
using CampusAppWP8.Resources;
|
||||
using Microsoft.Phone.Controls;
|
||||
using CampusAppWP8.Utility.Lui.MessageBoxes;
|
||||
|
||||
/// <summary>
|
||||
/// Class of the RoomListPage
|
||||
/// </summary>
|
||||
public partial class RoomListPage : PhoneApplicationPage
|
||||
{
|
||||
#region Members
|
||||
/// <summary>
|
||||
/// Variable of placeFile
|
||||
/// </summary>
|
||||
private PlacesFile placeFile;
|
||||
|
||||
/// <summary>
|
||||
/// Variable of building which is shown in the list
|
||||
/// </summary>
|
||||
private CampusBuildingModel building;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
||||
/// <summary>Initializes a new instance of the <see cref="RoomListPage" /> class.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
public RoomListPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Method
|
||||
|
||||
#region protected
|
||||
|
||||
/// <summary>Methods overrides the OnNavigatedTo-Method.</summary>
|
||||
/// <remarks>Stubbfel, 19.08.2013.</remarks>
|
||||
/// <param name="e">some NavigationEventArgs.</param>
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
|
||||
if (this.placeFile == null)
|
||||
{
|
||||
this.placeFile = new PlacesFile();
|
||||
this.placeFile.OnLoaded += new PlacesFile.OnIO(this.PlacesFileIsReady);
|
||||
this.placeFile.OnFailedLoad += new PlacesFile.OnFailed(this.PlacesFileIsFail);
|
||||
this.placeFile.LoadData();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private
|
||||
/// <summary>
|
||||
/// Callback of the PlaceFile, if load failed
|
||||
/// </summary>
|
||||
private void PlacesFileIsFail()
|
||||
{
|
||||
MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Callback of the PlaceFile, if load was successful
|
||||
/// </summary>
|
||||
private void PlacesFileIsReady()
|
||||
{
|
||||
if (this.placeFile.Model != null)
|
||||
{
|
||||
this.SetupPivot();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method setup the PivotElement
|
||||
/// </summary>
|
||||
private void SetupPivot()
|
||||
{
|
||||
if (NavigationContext.QueryString.ContainsKey(Constants.ParamBuildingId))
|
||||
{
|
||||
this.building = new CampusBuildingModel(NavigationContext.QueryString[Constants.ParamBuildingId], this.placeFile.Model.Places.ToList());
|
||||
|
||||
if (this.building != null && this.building.Layers != null && this.building.Layers.Count > 0)
|
||||
{
|
||||
this.SetCaptionsToRooms();
|
||||
this.RoomPivot.ItemsSource = this.GetSortedLayers(this.building);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBoxes.ShowMainModelErrorMessageBox(AppResources.MsgBox_ErrorMainModelLoad);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method sorts the Layers
|
||||
/// </summary>
|
||||
/// <param name="build"> building of the layers </param>
|
||||
/// <returns>sorted Dictionary</returns>
|
||||
private Dictionary<string, CampusBuildingLayerModel> GetSortedLayers(CampusBuildingModel build)
|
||||
{
|
||||
Dictionary<string, CampusBuildingLayerModel> result = new Dictionary<string, CampusBuildingLayerModel>();
|
||||
foreach (CampusBuildingLayerModel layer in build.Layers.Values)
|
||||
{
|
||||
var sortRom = from place in layer.Rooms.Places
|
||||
orderby place.GetInformationsValue(Constants.PisInformationName_Typ), place.GetInformationsValue(Constants.PisInformationName_Name)
|
||||
select place;
|
||||
result.Add(layer.LayerId, new CampusBuildingLayerModel(layer.LayerId, sortRom.ToList()));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method set all rooms a formatted string , which will be show as buttonContent
|
||||
/// </summary>
|
||||
private void SetCaptionsToRooms()
|
||||
{
|
||||
string name;
|
||||
string type;
|
||||
foreach (CampusBuildingLayerModel layer in this.building.Layers.Values)
|
||||
{
|
||||
foreach (PlaceModel place in layer.Rooms.Places)
|
||||
{
|
||||
name = place.GetInformationsValue(Constants.PisInformationName_Name);
|
||||
type = place.GetInformationsValue(Constants.PisInformationName_Typ);
|
||||
if (name != null && type != null)
|
||||
{
|
||||
place.Caption = name + " (" + type + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ namespace CampusAppWP8.Pages.Dev
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Windows;
|
||||
using System.Windows.Navigation;
|
||||
@@ -18,6 +19,7 @@ namespace CampusAppWP8.Pages.Dev
|
||||
using CampusAppWP8.Utility.NDEF;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Windows.Networking.Proximity;
|
||||
using CampusAppWP8.File.Places;
|
||||
|
||||
/// <summary>Nfc page.</summary>
|
||||
/// <remarks>Stubbfel, 22.08.2013.</remarks>
|
||||
@@ -34,6 +36,8 @@ namespace CampusAppWP8.Pages.Dev
|
||||
/// <summary>List of ndefs.</summary>
|
||||
private List<NDEFMessage> ndefList;
|
||||
|
||||
private PlacesFile file;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -43,14 +47,30 @@ namespace CampusAppWP8.Pages.Dev
|
||||
public NFC()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
if (this.file == null)
|
||||
{
|
||||
this.file = new PlacesFile();
|
||||
}
|
||||
|
||||
this.file.OnLoaded += new PlacesFile.OnIO(this.FileIsReady);
|
||||
this.file.LoadData();
|
||||
|
||||
|
||||
|
||||
this.actNDEFIndex = 0;
|
||||
}
|
||||
|
||||
private void FileIsReady()
|
||||
{
|
||||
this.ndefList = new List<NDEFMessage>();
|
||||
MapModel map = new CBMainMapModel();
|
||||
MapModel map = new CBMainMapModel(this.file.Model.Places.ToList());
|
||||
foreach (PlaceModel place in map.Spatial.Places)
|
||||
{
|
||||
this.ndefList.Add(new NDEFMessage(place.ToNfcString(), NDEFMessage.TYPEVAL.TEXT));
|
||||
}
|
||||
|
||||
this.actNDEFIndex = 0;
|
||||
this.Writecontent.Text = this.ndefList[this.actNDEFIndex].GetContent();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -65,7 +85,6 @@ namespace CampusAppWP8.Pages.Dev
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
base.OnNavigatedTo(e);
|
||||
this.Writecontent.Text = this.ndefList[this.actNDEFIndex].GetContent();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace CampusAppWP8.Pages.Dev
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using Microsoft.Devices;
|
||||
using Microsoft.Phone.Controls;
|
||||
using ZXing;
|
||||
@@ -35,20 +36,23 @@ namespace CampusAppWP8.Pages.Dev
|
||||
|
||||
/// <summary>Thread for transfer the preview image to the reader.</summary>
|
||||
private Thread captureThread = null;
|
||||
|
||||
|
||||
/// <summary>For ending the thread.</summary>
|
||||
private volatile bool captureThreadExit = false;
|
||||
|
||||
|
||||
/// <summary>QR reader object.</summary>
|
||||
private IBarcodeReader barcodeReader = null;
|
||||
|
||||
|
||||
/// <summary>Bitmap for transfer the camera image to the reader.</summary>
|
||||
private WriteableBitmap bit = null;
|
||||
|
||||
/// <summary>true if this object is in autofocus. </summary>
|
||||
private bool isInAutofocus = false;
|
||||
|
||||
private string ResultAppStoreKey;
|
||||
/// <summary>
|
||||
/// Variable for the storage key of the result
|
||||
/// </summary>
|
||||
private string resultAppStoreKey;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -77,15 +81,15 @@ namespace CampusAppWP8.Pages.Dev
|
||||
{
|
||||
if (NavigationContext.QueryString.ContainsKey(Constants.ParamQRResultKey))
|
||||
{
|
||||
this.ResultAppStoreKey = NavigationContext.QueryString[Constants.ParamQRResultKey];
|
||||
this.resultAppStoreKey = NavigationContext.QueryString[Constants.ParamQRResultKey];
|
||||
}
|
||||
|
||||
this.cam = new PhotoCamera(CameraType.Primary);
|
||||
this.cam.Initialized += new EventHandler<CameraOperationCompletedEventArgs>(this.Cam_Initialized);
|
||||
this.cam.AutoFocusCompleted += new EventHandler<CameraOperationCompletedEventArgs>(this.Cam_AutoFocusCompl);
|
||||
this.bit = new WriteableBitmap((int)this.cam.PreviewResolution.Width, (int)this.cam.PreviewResolution.Height);
|
||||
|
||||
|
||||
this.camViewBrush.SetSource(this.cam);
|
||||
this.isInAutofocus = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -95,7 +99,7 @@ namespace CampusAppWP8.Pages.Dev
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Is called when this page will not be the current page of a frame.
|
||||
/// </summary>
|
||||
@@ -106,7 +110,7 @@ namespace CampusAppWP8.Pages.Dev
|
||||
{
|
||||
this.captureThreadExit = true;
|
||||
this.captureThread.Join();
|
||||
|
||||
|
||||
this.cam.Dispose();
|
||||
|
||||
this.bit = null;
|
||||
@@ -123,23 +127,23 @@ namespace CampusAppWP8.Pages.Dev
|
||||
|
||||
switch (e.Orientation)
|
||||
{
|
||||
case PageOrientation.Landscape:
|
||||
this.camViewBrushTransform.Rotation = 0;
|
||||
case PageOrientation.Landscape:
|
||||
this.camViewBrushTransform.Rotation = 0;
|
||||
break;
|
||||
case PageOrientation.LandscapeLeft:
|
||||
this.camViewBrushTransform.Rotation = 0;
|
||||
case PageOrientation.LandscapeLeft:
|
||||
this.camViewBrushTransform.Rotation = 0;
|
||||
break;
|
||||
case PageOrientation.LandscapeRight:
|
||||
this.camViewBrushTransform.Rotation = 180;
|
||||
case PageOrientation.LandscapeRight:
|
||||
this.camViewBrushTransform.Rotation = 180;
|
||||
break;
|
||||
case PageOrientation.Portrait:
|
||||
this.camViewBrushTransform.Rotation = 90;
|
||||
case PageOrientation.Portrait:
|
||||
this.camViewBrushTransform.Rotation = 90;
|
||||
break;
|
||||
case PageOrientation.PortraitUp:
|
||||
this.camViewBrushTransform.Rotation = 90;
|
||||
case PageOrientation.PortraitUp:
|
||||
this.camViewBrushTransform.Rotation = 90;
|
||||
break;
|
||||
case PageOrientation.PortraitDown:
|
||||
this.camViewBrushTransform.Rotation = 270;
|
||||
case PageOrientation.PortraitDown:
|
||||
this.camViewBrushTransform.Rotation = 270;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -187,11 +191,11 @@ namespace CampusAppWP8.Pages.Dev
|
||||
if (this.cam.IsFocusAtPointSupported == true)
|
||||
{
|
||||
Point pos = e.GetPosition(this.camView);
|
||||
|
||||
|
||||
this.cam.FocusAtPoint(
|
||||
pos.Y / this.camView.ActualHeight,
|
||||
pos.Y / this.camView.ActualHeight,
|
||||
1.0 - (pos.X / this.camView.ActualWidth));
|
||||
|
||||
|
||||
this.isInAutofocus = true;
|
||||
}
|
||||
else if (this.cam.IsFocusSupported == true)
|
||||
@@ -212,15 +216,26 @@ namespace CampusAppWP8.Pages.Dev
|
||||
Array.Copy(img, this.bit.Pixels, img.Length);
|
||||
|
||||
var result = this.barcodeReader.Decode(this.bit);
|
||||
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
Dispatcher.BeginInvoke(delegate
|
||||
{
|
||||
if (this.ResultAppStoreKey != null)
|
||||
if (this.resultAppStoreKey != null)
|
||||
{
|
||||
App.SaveToIsolatedStorage(this.ResultAppStoreKey, result.Text);
|
||||
NavigationService.GoBack();
|
||||
if (NavigationService.CanGoBack)
|
||||
{
|
||||
App.SaveToIsolatedStorage(this.resultAppStoreKey, result.Text);
|
||||
NavigationService.GoBack();
|
||||
}
|
||||
else
|
||||
{
|
||||
string pid = Wp8StringManager.FilterPlaceIdinQRResultString(result.Text);
|
||||
string urlString = Constants.PathCampusmap_Campusmap;
|
||||
urlString += "?" + Constants.ParamModelMap_SearchTermAlias + "=" + pid;
|
||||
Uri url = new Uri(urlString as string, UriKind.Relative);
|
||||
NavigationService.Navigate(url);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -246,7 +261,7 @@ namespace CampusAppWP8.Pages.Dev
|
||||
|
||||
this.OnCaptureImage(buffer, (int)resolution.Width, (int)resolution.Height);
|
||||
}
|
||||
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
using CampusAppWP8.Resources;
|
||||
using CampusAppWP8.Utility;
|
||||
using CampusAppWP8.Utility.Lui.MessageBoxes;
|
||||
using CampusAppWPortalLib8.Model.Mensa;
|
||||
using Microsoft.Phone.Controls;
|
||||
using Microsoft.Phone.Shell;
|
||||
using CampusAppWPortalLib8.Model.Mensa;
|
||||
|
||||
/// <summary>
|
||||
/// Class for the MensaPage
|
||||
@@ -231,10 +231,57 @@ namespace CampusAppWP8.Pages.Mensa
|
||||
private void SetupMensaPivot()
|
||||
{
|
||||
this.MensaPivot.Title = AppResources.MensaApp_Title + " (" + this.feed.Title + ")";
|
||||
this.CreatesMealIcons();
|
||||
this.MensaPivot.ItemsSource = this.feed.Model.Menus;
|
||||
this.MensaPivot.SelectedIndex = this.selectedIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method create the IconsUrl for the meals
|
||||
/// </summary>
|
||||
private void CreatesMealIcons()
|
||||
{
|
||||
foreach (MenuModel menus in this.feed.Model.Menus)
|
||||
{
|
||||
foreach (MealModel meal in menus.Meals)
|
||||
{
|
||||
switch (meal.IconName)
|
||||
{
|
||||
case MealModel.MealIconNameCow:
|
||||
meal.IconUrl = Icons.Cow;
|
||||
break;
|
||||
case MealModel.MealIconNameCowPig:
|
||||
meal.IconUrl = Icons.CowPig;
|
||||
break;
|
||||
case MealModel.MealIconNameFish:
|
||||
meal.IconUrl = Icons.Fish;
|
||||
break;
|
||||
case MealModel.MealIconNameFowl:
|
||||
meal.IconUrl = Icons.Fowl;
|
||||
break;
|
||||
case MealModel.MealIconNameFree:
|
||||
meal.IconUrl = Icons.Free;
|
||||
break;
|
||||
case MealModel.MealIconNameLamb:
|
||||
meal.IconUrl = Icons.Lamb;
|
||||
break;
|
||||
case MealModel.MealIconNamePig:
|
||||
meal.IconUrl = Icons.Pig;
|
||||
break;
|
||||
case MealModel.MealIconNameVegetarian:
|
||||
meal.IconUrl = Icons.Vegetarian;
|
||||
break;
|
||||
case MealModel.MealIconNameWild:
|
||||
meal.IconUrl = Icons.Wild;
|
||||
break;
|
||||
default:
|
||||
meal.IconUrl = string.Empty;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method calculate which pivot has to be selected
|
||||
/// </summary>
|
||||
|
||||
@@ -418,7 +418,6 @@ namespace CampusAppWP8.Pages.PlaceNews
|
||||
txt.Text = place.GetInformationsValue(Constants.PisInformationName_Name);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Handler, called when the ndef.</summary>
|
||||
/// <remarks>Stubbfel, 22.08.2013.</remarks>
|
||||
/// <param name="sender"> The sender.</param>
|
||||
|
||||
@@ -83,6 +83,13 @@ namespace CampusAppWP8.Pages
|
||||
this.initCourseList.LoadData();
|
||||
this.ShowOptIns();
|
||||
Settings.AppSetting.InitApp = true;
|
||||
|
||||
int appDeploy;
|
||||
bool parseResult = int.TryParse(Constants.DeploymentNumber, out appDeploy);
|
||||
if (parseResult)
|
||||
{
|
||||
Settings.AppSetting.DeploymentNumber = appDeploy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2012/deployment" AppPlatformVersion="8.0">
|
||||
<DefaultLanguage xmlns="" code="de-DE" />
|
||||
<App xmlns="" ProductID="{120b88cc-f3f0-4c5a-a3fd-c26e835338cc}" Title="CampusAppWP8" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="CampusAppWP8 author" Description="Die BTU-CampusApp für WP8" Publisher="CampusAppWP8" PublisherID="{3511cc48-91b0-4ffb-9023-b69a81021a46}">
|
||||
<IconPath IsRelative="true" IsResource="false">Assets\Tiles\kachel_small.png</IconPath>
|
||||
<App xmlns="" ProductID="{120b88cc-f3f0-4c5a-a3fd-c26e835338cc}" Title="BTU-CampusApp" RuntimeType="Silverlight" Version="1.0.0.0" Genre="apps.normal" Author="CampusAppWP8 author" Description="Die BTU-CampusApp für WP8" Publisher="CampusAppWP8" PublisherID="{3511cc48-91b0-4ffb-9023-b69a81021a46}">
|
||||
<IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
|
||||
<Capabilities>
|
||||
<Capability Name="ID_CAP_NETWORKING" />
|
||||
<Capability Name="ID_CAP_SENSORS" />
|
||||
@@ -22,27 +22,30 @@
|
||||
</Tasks>
|
||||
<Tokens>
|
||||
<PrimaryToken TokenID="CampusAppWP8Token" TaskName="_default">
|
||||
<TemplateFlip>
|
||||
<TemplateIconic>
|
||||
<SmallImageURI IsRelative="true" IsResource="false">Assets\Tiles\kachel_small.png</SmallImageURI>
|
||||
<Count>0</Count>
|
||||
<BackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\kachel_medium.png</BackgroundImageURI>
|
||||
<Title>CampusAppWP8</Title>
|
||||
<BackContent>
|
||||
</BackContent>
|
||||
<BackBackgroundImageURI>
|
||||
</BackBackgroundImageURI>
|
||||
<BackTitle>
|
||||
</BackTitle>
|
||||
<LargeBackgroundImageURI IsRelative="true" IsResource="false">Assets\Tiles\kachel_large.png</LargeBackgroundImageURI>
|
||||
<LargeBackContent />
|
||||
<LargeBackBackgroundImageURI IsRelative="true" IsResource="false">
|
||||
</LargeBackBackgroundImageURI>
|
||||
<DeviceLockImageURI>
|
||||
</DeviceLockImageURI>
|
||||
<IconImageURI IsRelative="true" IsResource="false">Assets\Tiles\kachel_medium.png</IconImageURI>
|
||||
<Title>BTU-CampusApp</Title>
|
||||
<Message>
|
||||
</Message>
|
||||
<BackgroundColor>
|
||||
</BackgroundColor>
|
||||
<HasLarge>True</HasLarge>
|
||||
</TemplateFlip>
|
||||
<LargeContent1>
|
||||
</LargeContent1>
|
||||
<LargeContent2>
|
||||
</LargeContent2>
|
||||
<LargeContent3>
|
||||
</LargeContent3>
|
||||
<DeviceLockImageURI IsRelative="true" IsResource="false">
|
||||
</DeviceLockImageURI>
|
||||
</TemplateIconic>
|
||||
</PrimaryToken>
|
||||
</Tokens>
|
||||
<Extensions>
|
||||
<Extension ExtensionName="Camera_Capture_App" ConsumerID="{5B04B775-356B-4AA0-AAF8-6491FFEA5631}" TaskID="_default" />
|
||||
</Extensions>
|
||||
<ScreenResolutions>
|
||||
<ScreenResolution Name="ID_RESOLUTION_WVGA" />
|
||||
<ScreenResolution Name="ID_RESOLUTION_WXGA" />
|
||||
|
||||
@@ -177,6 +177,24 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Gebäudeinfos ausblenden ähnelt.
|
||||
/// </summary>
|
||||
public static string CampusMapApp_DisableBuildInfo {
|
||||
get {
|
||||
return ResourceManager.GetString("CampusMapApp_DisableBuildInfo", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Gebäudeinfos einblenden ähnelt.
|
||||
/// </summary>
|
||||
public static string CampusMapApp_EnableBuildInfo {
|
||||
get {
|
||||
return ResourceManager.GetString("CampusMapApp_EnableBuildInfo", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Info via NFC ähnelt.
|
||||
/// </summary>
|
||||
@@ -771,6 +789,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Für dieses Gebäude gibt es eine Raumübersicht. Soll diese angezeigt werden? ähnelt.
|
||||
/// </summary>
|
||||
public static string MsgBox_ShowRoomList {
|
||||
get {
|
||||
return ResourceManager.GetString("MsgBox_ShowRoomList", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die News ähnelt.
|
||||
/// </summary>
|
||||
@@ -879,6 +906,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Barrierefreiheit ähnelt.
|
||||
/// </summary>
|
||||
public static string PlaceLabel_Accessbility {
|
||||
get {
|
||||
return ResourceManager.GetString("PlaceLabel_Accessbility", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Name ähnelt.
|
||||
/// </summary>
|
||||
@@ -897,6 +933,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Type ähnelt.
|
||||
/// </summary>
|
||||
public static string PlaceLabel_Type {
|
||||
get {
|
||||
return ResourceManager.GetString("PlaceLabel_Type", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Placenews ähnelt.
|
||||
/// </summary>
|
||||
|
||||
@@ -532,5 +532,19 @@
|
||||
</data>
|
||||
<data name="Creating" xml:space="preserve">
|
||||
<value>Erstellen</value>
|
||||
<data name="PlaceLabel_Accessbility" xml:space="preserve">
|
||||
<value>Barrierefreiheit</value>
|
||||
</data>
|
||||
<data name="CampusMapApp_DisableBuildInfo" xml:space="preserve">
|
||||
<value>Gebäudeinfos ausblenden</value>
|
||||
</data>
|
||||
<data name="CampusMapApp_EnableBuildInfo" xml:space="preserve">
|
||||
<value>Gebäudeinfos einblenden</value>
|
||||
</data>
|
||||
<data name="MsgBox_ShowRoomList" xml:space="preserve">
|
||||
<value>Für dieses Gebäude gibt es eine Raumübersicht. Soll diese angezeigt werden?</value>
|
||||
</data>
|
||||
<data name="PlaceLabel_Type" xml:space="preserve">
|
||||
<value>Type</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -528,4 +528,37 @@
|
||||
<data name="NCFMessageType_NDEF" xml:space="preserve">
|
||||
<value>NDEF</value>
|
||||
</data>
|
||||
<data name="ParamBuildingId" xml:space="preserve">
|
||||
<value>BuildingId</value>
|
||||
</data>
|
||||
<data name="PathCampusmap_RoomListPage" xml:space="preserve">
|
||||
<value>/Pages/Campusmap/RoomListPage.xaml</value>
|
||||
</data>
|
||||
<data name="PisInformationName_Layer" xml:space="preserve">
|
||||
<value>Ebene</value>
|
||||
</data>
|
||||
<data name="PisInformationName_Accesbility" xml:space="preserve">
|
||||
<value>Barrierefreiheit</value>
|
||||
</data>
|
||||
<data name="PathApp_StartPage" xml:space="preserve">
|
||||
<value>/Pages/StartPage.xaml</value>
|
||||
</data>
|
||||
<data name="PinType_CurrentPosition" xml:space="preserve">
|
||||
<value>CurrentPositionPin</value>
|
||||
</data>
|
||||
<data name="PinType_Hidden" xml:space="preserve">
|
||||
<value>HiddenPin</value>
|
||||
</data>
|
||||
<data name="PinType_Info" xml:space="preserve">
|
||||
<value>InfoPin</value>
|
||||
</data>
|
||||
<data name="PinType_Search" xml:space="preserve">
|
||||
<value>SearchPin</value>
|
||||
</data>
|
||||
<data name="AppSetting_DeploymentNumber" xml:space="preserve">
|
||||
<value>DeploymentNumber</value>
|
||||
</data>
|
||||
<data name="DeploymentNumber" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -105,6 +105,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die DeploymentNumber ähnelt.
|
||||
/// </summary>
|
||||
public static string AppSetting_DeploymentNumber {
|
||||
get {
|
||||
return ResourceManager.GetString("AppSetting_DeploymentNumber", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die DevMode ähnelt.
|
||||
/// </summary>
|
||||
@@ -186,6 +195,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die 3 ähnelt.
|
||||
/// </summary>
|
||||
public static string DeploymentNumber {
|
||||
get {
|
||||
return ResourceManager.GetString("DeploymentNumber", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die +49 ähnelt.
|
||||
/// </summary>
|
||||
@@ -582,6 +600,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die BuildingId ähnelt.
|
||||
/// </summary>
|
||||
public static string ParamBuildingId {
|
||||
get {
|
||||
return ResourceManager.GetString("ParamBuildingId", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Studiengang ähnelt.
|
||||
/// </summary>
|
||||
@@ -699,6 +726,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/StartPage.xaml ähnelt.
|
||||
/// </summary>
|
||||
public static string PathApp_StartPage {
|
||||
get {
|
||||
return ResourceManager.GetString("PathApp_StartPage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Campusmap/CampusMapPage.xaml ähnelt.
|
||||
/// </summary>
|
||||
@@ -708,6 +744,15 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Campusmap/RoomListPage.xaml ähnelt.
|
||||
/// </summary>
|
||||
public static string PathCampusmap_RoomListPage {
|
||||
get {
|
||||
return ResourceManager.GetString("PathCampusmap_RoomListPage", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die /Pages/Departments/DepartmentFavoritePage.xaml ähnelt.
|
||||
/// </summary>
|
||||
@@ -933,6 +978,42 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die CurrentPositionPin ähnelt.
|
||||
/// </summary>
|
||||
public static string PinType_CurrentPosition {
|
||||
get {
|
||||
return ResourceManager.GetString("PinType_CurrentPosition", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die HiddenPin ähnelt.
|
||||
/// </summary>
|
||||
public static string PinType_Hidden {
|
||||
get {
|
||||
return ResourceManager.GetString("PinType_Hidden", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die InfoPin ähnelt.
|
||||
/// </summary>
|
||||
public static string PinType_Info {
|
||||
get {
|
||||
return ResourceManager.GetString("PinType_Info", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die SearchPin ähnelt.
|
||||
/// </summary>
|
||||
public static string PinType_Search {
|
||||
get {
|
||||
return ResourceManager.GetString("PinType_Search", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die iname ähnelt.
|
||||
/// </summary>
|
||||
@@ -951,6 +1032,24 @@ namespace CampusAppWP8.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Barrierefreiheit ähnelt.
|
||||
/// </summary>
|
||||
public static string PisInformationName_Accesbility {
|
||||
get {
|
||||
return ResourceManager.GetString("PisInformationName_Accesbility", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Ebene ähnelt.
|
||||
/// </summary>
|
||||
public static string PisInformationName_Layer {
|
||||
get {
|
||||
return ResourceManager.GetString("PisInformationName_Layer", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Name ähnelt.
|
||||
/// </summary>
|
||||
@@ -62,7 +62,7 @@ namespace CampusAppWP8.Resources
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("info_159.png");
|
||||
return Themerize("steak_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace CampusAppWP8.Resources
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("info_159.png");
|
||||
return Themerize("pork_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace CampusAppWP8.Resources
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("info_159.png");
|
||||
return Themerize("fish_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace CampusAppWP8.Resources
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("info_159.png");
|
||||
return Themerize("chicken_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace CampusAppWP8.Resources
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("info_159.png");
|
||||
return Themerize("frei_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace CampusAppWP8.Resources
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("info_159.png");
|
||||
return Themerize("lamb_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +304,18 @@ namespace CampusAppWP8.Resources
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("info_159.png");
|
||||
return Themerize("pork_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the uri string of the PlaceInfo icon.
|
||||
/// </summary>
|
||||
public static string PlaceInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("placeinfo_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,7 +414,7 @@ namespace CampusAppWP8.Resources
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("info_159.png");
|
||||
return Themerize("carotte_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,7 +436,7 @@ namespace CampusAppWP8.Resources
|
||||
{
|
||||
get
|
||||
{
|
||||
return Themerize("info_159.png");
|
||||
return Themerize("wilddish_159.png");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -127,10 +127,10 @@
|
||||
<value>campus_159.png</value>
|
||||
</data>
|
||||
<data name="Cow" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
<value>steak_159.png</value>
|
||||
</data>
|
||||
<data name="CowPig" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
<value>pork_159.png</value>
|
||||
</data>
|
||||
<data name="CurrentPosition" xml:space="preserve">
|
||||
<value>current_position_159.png</value>
|
||||
@@ -148,13 +148,13 @@
|
||||
<value>favorite_159.png</value>
|
||||
</data>
|
||||
<data name="Fish" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
<value>fish_159.png</value>
|
||||
</data>
|
||||
<data name="Fowl" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
<value>chicken_159.png</value>
|
||||
</data>
|
||||
<data name="Free" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
<value>frei_159.png</value>
|
||||
</data>
|
||||
<data name="Homework" xml:space="preserve">
|
||||
<value>homework_159.png</value>
|
||||
@@ -166,7 +166,7 @@
|
||||
<value>lab_159.png</value>
|
||||
</data>
|
||||
<data name="Lamb" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
<value>lamb_159.png</value>
|
||||
</data>
|
||||
<data name="Lecture" xml:space="preserve">
|
||||
<value>lecture_159.png</value>
|
||||
@@ -193,7 +193,10 @@
|
||||
<value>phone_159.png</value>
|
||||
</data>
|
||||
<data name="Pig" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
<value>pork_159.png</value>
|
||||
</data>
|
||||
<data name="PlaceInfo" xml:space="preserve">
|
||||
<value>placeinfo_159.png</value>
|
||||
</data>
|
||||
<data name="Practise" xml:space="preserve">
|
||||
<value>practise_159.png</value>
|
||||
@@ -220,12 +223,12 @@
|
||||
<value>update_159.png</value>
|
||||
</data>
|
||||
<data name="Vegetarian" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
<value>carotte_159.png</value>
|
||||
</data>
|
||||
<data name="WebMail" xml:space="preserve">
|
||||
<value>webmail_159.png</value>
|
||||
</data>
|
||||
<data name="Wild" xml:space="preserve">
|
||||
<value>info_159.png</value>
|
||||
<value>wild dish_159.png</value>
|
||||
</data>
|
||||
</root>
|
||||
43
CampusAppWP8/CampusAppWP8/Utility/AppUriMapper.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="AppUriMapper.cs" company="BTU/IIT">
|
||||
// Company copyright tag.
|
||||
// </copyright>
|
||||
// <author>stubbfel</author>
|
||||
// <sience>26.09.2013</sience>
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
namespace CampusAppWP8.Utility
|
||||
{
|
||||
using System;
|
||||
using System.Windows.Navigation;
|
||||
using CampusAppWP8.Resources;
|
||||
|
||||
/// <summary>
|
||||
/// Class map Uri to AppPages
|
||||
/// </summary>
|
||||
public class AppUriMapper : UriMapperBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Method overrides MapUri from UriMapperBase
|
||||
/// </summary>
|
||||
/// <param name="uri">the url</param>
|
||||
/// <returns>the mapped url</returns>
|
||||
public override Uri MapUri(Uri uri)
|
||||
{
|
||||
string tempUri = uri.ToString();
|
||||
|
||||
// Look for a URI from the lens picker.
|
||||
if (tempUri.Contains("ViewfinderLaunch"))
|
||||
{
|
||||
// Launch as a lens, launch viewfinder screen.
|
||||
tempUri = Constants.PathQR_QRPage;
|
||||
tempUri += "?" + Constants.ParamQRResultKey + "=" + Constants.CampusMapApp_QRCodeSearchResultStorageKey;
|
||||
Uri url = new Uri(tempUri as string, UriKind.Relative);
|
||||
return new Uri(tempUri, UriKind.Relative);
|
||||
}
|
||||
|
||||
// Otherwise perform normal launch.
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,52 +74,21 @@ namespace CampusAppWP8.Utility
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method start MensaBackgroundTask
|
||||
/// Method start BTUCampusAppBackgroundTask
|
||||
/// </summary>
|
||||
public static void StartMensaTask()
|
||||
public static void StartBTUCampusAppTask()
|
||||
{
|
||||
int campusId = (int)Settings.UserProfil.DefaultCampus;
|
||||
BackgroundTasks.StartPerodicTask(Constants.BackgroundTask_Mensa, AppResources.BackGroundTaskDesc_Mensa + " - Feed " + campusId);
|
||||
BackgroundTasks.StartPerodicTask(Constants.BackgroundTask_BTUCampusApp, AppResources.BackGroundTaskDesc_BTUCampusApp + " - Feed " + campusId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method stop MensaBackgroundTask
|
||||
/// Method stop BTUCampusAppBackgroundTask
|
||||
/// </summary>
|
||||
public static void StopMensaTask()
|
||||
public static void StopBTUCampusAppTask()
|
||||
{
|
||||
BackgroundTasks.StopPerodicTask(Constants.BackgroundTask_Mensa);
|
||||
BackgroundTasks.StopPerodicTask(Constants.BackgroundTask_BTUCampusApp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method start EventBackgroundTask
|
||||
/// </summary>
|
||||
public static void StartEventTask()
|
||||
{
|
||||
BackgroundTasks.StartPerodicTask(Constants.BackgroundTask_Event, AppResources.BackGroundTaskDesc_Event);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method stop EventBackgroundTask
|
||||
/// </summary>
|
||||
public static void StopEventTask()
|
||||
{
|
||||
BackgroundTasks.StopPerodicTask(Constants.BackgroundTask_Event);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method start NewsBackgroundTask
|
||||
/// </summary>
|
||||
public static void StartNewsTask()
|
||||
{
|
||||
BackgroundTasks.StartPerodicTask(Constants.BackgroundTask_News, AppResources.BackGroundTaskDesc_News);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method stop NewsBackgroundTask
|
||||
/// </summary>
|
||||
public static void StopNewsTask()
|
||||
{
|
||||
BackgroundTasks.StopPerodicTask(Constants.BackgroundTask_News);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,15 @@ namespace CampusAppWP8.Utility.Lui.MessageBoxes
|
||||
return MessageBox.Show(text, AppResources.MsgBox_PlaceInfoHeader, MessageBoxButton.OK);
|
||||
}
|
||||
|
||||
/// <summary>Shows the place information message box (OKCancel-Box).</summary>
|
||||
/// <remarks>Stubbfel, 10.09.2013.</remarks>
|
||||
/// <param name="text">custom text for the box.</param>
|
||||
/// <returns>result of the UserInteraction</returns>
|
||||
public static MessageBoxResult ShowPlaceInfoOkCancelMessageBox(string text)
|
||||
{
|
||||
return MessageBox.Show(text, AppResources.MsgBox_PlaceInfoHeader, MessageBoxButton.OKCancel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
TileCreator.CreateIconicTile(AppResources.MensaApp_Title, Constants.PathMensa_MensaPage, Icons.Mensa, Icons.Mensa);
|
||||
|
||||
// create a new task
|
||||
BackgroundTasks.StartMensaTask();
|
||||
BackgroundTasks.StartBTUCampusAppTask();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -77,7 +77,7 @@ namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
TileCreator.CreateIconicTile(AppResources.NewsApp_Title, Constants.PathNews_NewsIndexPage, Icons.News, Icons.News);
|
||||
|
||||
// create a new Task
|
||||
BackgroundTasks.StartNewsTask();
|
||||
BackgroundTasks.StartBTUCampusAppTask();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -96,7 +96,7 @@ namespace CampusAppWP8.Utility.Lui.Tiles
|
||||
TileCreator.CreateIconicTile(AppResources.EventApp_Title, Constants.PathEvents_EventsIndexPage, Icons.News, Icons.News);
|
||||
|
||||
// create a new taskk
|
||||
BackgroundTasks.StartEventTask();
|
||||
BackgroundTasks.StartBTUCampusAppTask();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -125,9 +125,10 @@ namespace CampusAppWP8.Utility
|
||||
{
|
||||
retValue.Add(child);
|
||||
}
|
||||
|
||||
var ret = retValue.Concat<DependencyObject>(GetChild(child as DependencyObject, elemName));
|
||||
retValue = ret.ToList<DependencyObject>();
|
||||
else
|
||||
{
|
||||
retValue.AddRange(Utilities.GetChild(child as DependencyObject, elemName));
|
||||
}
|
||||
}
|
||||
|
||||
return retValue;
|
||||
@@ -239,6 +240,16 @@ namespace CampusAppWP8.Utility
|
||||
return geoposition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method set current positon to Zero
|
||||
/// </summary>
|
||||
public static void SetGeoPositionToZero()
|
||||
{
|
||||
string time = DateTime.Now.Ticks.ToString();
|
||||
App.SaveToAppState<string>(Constants.GeoWatch_CurrentPosition_Lat, "0");
|
||||
App.SaveToAppState<string>(Constants.GeoWatch_CurrentPosition_Long, "0");
|
||||
App.SaveToAppState<string>(Constants.GeoWatch_CurrentPosition_Time, time);
|
||||
}
|
||||
/// <summary>
|
||||
/// Method determine and store the current position of the phone
|
||||
/// </summary>
|
||||
|
||||
@@ -61,29 +61,11 @@ namespace CampusAppWP8ScheduledTaskAgent.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Hintergrunddienst für die BTU-Event-Feed ähnelt.
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Hintergrunddienst für die BTU-CampusApp ähnelt.
|
||||
/// </summary>
|
||||
public static string BackGroundTaskDesc_Event {
|
||||
public static string BackGroundTaskDesc_BTUCampusApp {
|
||||
get {
|
||||
return ResourceManager.GetString("BackGroundTaskDesc_Event", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Hintergrunddienst für die BTU-Mensa ähnelt.
|
||||
/// </summary>
|
||||
public static string BackGroundTaskDesc_Mensa {
|
||||
get {
|
||||
return ResourceManager.GetString("BackGroundTaskDesc_Mensa", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die Hintergrunddienst für die BTU-News-Feed ähnelt.
|
||||
/// </summary>
|
||||
public static string BackGroundTaskDesc_News {
|
||||
get {
|
||||
return ResourceManager.GetString("BackGroundTaskDesc_News", resourceCulture);
|
||||
return ResourceManager.GetString("BackGroundTaskDesc_BTUCampusApp", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,14 +117,8 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="BackGroundTaskDesc_Mensa" xml:space="preserve">
|
||||
<value>Hintergrunddienst für die BTU-Mensa</value>
|
||||
</data>
|
||||
<data name="BackGroundTaskDesc_Event" xml:space="preserve">
|
||||
<value>Hintergrunddienst für die BTU-Event-Feed</value>
|
||||
</data>
|
||||
<data name="BackGroundTaskDesc_News" xml:space="preserve">
|
||||
<value>Hintergrunddienst für die BTU-News-Feed</value>
|
||||
<data name="BackGroundTaskDesc_BTUCampusApp" xml:space="preserve">
|
||||
<value>Hintergrunddienst für die BTU-CampusApp</value>
|
||||
</data>
|
||||
<data name="MensaApp_CloseMensa" xml:space="preserve">
|
||||
<value>Die Mensa ist heute geschlossen</value>
|
||||
|
||||
@@ -117,13 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="BackgroundTask_Mensa" xml:space="preserve">
|
||||
<value>MensaTask</value>
|
||||
</data>
|
||||
<data name="BackgroundTask_Event" xml:space="preserve">
|
||||
<value>EventTask</value>
|
||||
</data>
|
||||
<data name="BackgroundTask_News" xml:space="preserve">
|
||||
<value>NewsTask</value>
|
||||
<data name="BackgroundTask_BTUCampusApp" xml:space="preserve">
|
||||
<value>BTUCampusAppTask</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -61,29 +61,11 @@ namespace CampusAppWP8ScheduledTaskAgent.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die EventTask ähnelt.
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die BTUCampusAppTask ähnelt.
|
||||
/// </summary>
|
||||
public static string BackgroundTask_Event {
|
||||
public static string BackgroundTask_BTUCampusApp {
|
||||
get {
|
||||
return ResourceManager.GetString("BackgroundTask_Event", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die MensaTask ähnelt.
|
||||
/// </summary>
|
||||
public static string BackgroundTask_Mensa {
|
||||
get {
|
||||
return ResourceManager.GetString("BackgroundTask_Mensa", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sucht eine lokalisierte Zeichenfolge, die NewsTask ähnelt.
|
||||
/// </summary>
|
||||
public static string BackgroundTask_News {
|
||||
get {
|
||||
return ResourceManager.GetString("BackgroundTask_News", resourceCulture);
|
||||
return ResourceManager.GetString("BackgroundTask_BTUCampusApp", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace CampusAppWP8ScheduledTaskAgent
|
||||
/// </summary>
|
||||
private RSSViewModel newsModel;
|
||||
|
||||
/// <summary>
|
||||
/// Variable for the runnig feeds
|
||||
/// </summary>
|
||||
private int runningFeeds;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
@@ -70,19 +75,44 @@ namespace CampusAppWP8ScheduledTaskAgent
|
||||
/// <param name="task">the background Task</param>
|
||||
protected override void OnInvoke(ScheduledTask task)
|
||||
{
|
||||
switch (task.Name)
|
||||
int notRunningFeeds = 0;
|
||||
this.runningFeeds = 0;
|
||||
ShellTile tileToFind = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains(CampusAppWPortalLib8.Resources.Constants.PathNews_NewsIndexPage));
|
||||
if (tileToFind != null && tileToFind.NavigationUri.ToString().Contains(CampusAppWPortalLib8.Resources.Constants.PathNews_NewsIndexPage))
|
||||
{
|
||||
case "MensaTask":
|
||||
this.HandleMensaTask(task);
|
||||
break;
|
||||
this.runningFeeds++;
|
||||
this.HandleNewsTask(task);
|
||||
}
|
||||
else
|
||||
{
|
||||
notRunningFeeds++;
|
||||
}
|
||||
|
||||
case "EventTask":
|
||||
this.HandleEventTask(task);
|
||||
break;
|
||||
tileToFind = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains(CampusAppWPortalLib8.Resources.Constants.PathMensa_MensaPage));
|
||||
if (tileToFind != null && tileToFind.NavigationUri.ToString().Contains(CampusAppWPortalLib8.Resources.Constants.PathMensa_MensaPage))
|
||||
{
|
||||
this.runningFeeds++;
|
||||
this.HandleMensaTask(task);
|
||||
}
|
||||
else
|
||||
{
|
||||
notRunningFeeds++;
|
||||
}
|
||||
|
||||
case "NewsTask":
|
||||
this.HandleNewsTask(task);
|
||||
break;
|
||||
tileToFind = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains(CampusAppWPortalLib8.Resources.Constants.PathEvents_EventsIndexPage));
|
||||
if (tileToFind != null && tileToFind.NavigationUri.ToString().Contains(CampusAppWPortalLib8.Resources.Constants.PathEvents_EventsIndexPage))
|
||||
{
|
||||
this.runningFeeds++;
|
||||
this.HandleEventTask(task);
|
||||
}
|
||||
else
|
||||
{
|
||||
notRunningFeeds++;
|
||||
}
|
||||
|
||||
if (notRunningFeeds == 3)
|
||||
{
|
||||
BackgroundTasks.StopPerodicTask(Constants.BackgroundTask_BTUCampusApp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,15 +213,15 @@ namespace CampusAppWP8ScheduledTaskAgent
|
||||
data.WideContent1 = item.Date;
|
||||
data.WideContent2 = DefaultStringManager.ToShortString(item.Title, 40, "...");
|
||||
data.WideContent3 = DefaultStringManager.ToShortString(item.Text, 40, "...");
|
||||
data.Count = this.newsModel.Channel[0].Item.Count;
|
||||
//data.Count = this.newsModel.Channel[0].Item.Count;
|
||||
tileToFind.Update(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
BackgroundTasks.StopPerodicTask(Constants.BackgroundTask_News);
|
||||
this.runningFeeds--;
|
||||
}
|
||||
|
||||
this.NotifyComplete();
|
||||
if (this.runningFeeds == 0)
|
||||
{
|
||||
this.NotifyComplete();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -210,15 +240,15 @@ namespace CampusAppWP8ScheduledTaskAgent
|
||||
data.WideContent1 = item.Date;
|
||||
data.WideContent2 = DefaultStringManager.ToShortString(item.Title, 40, "...");
|
||||
data.WideContent3 = DefaultStringManager.ToShortString(item.Text, 40, "...");
|
||||
data.Count = this.eventModel.Channel[0].Item.Count;
|
||||
//data.Count = this.eventModel.Channel[0].Item.Count;
|
||||
tileToFind.Update(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
BackgroundTasks.StopPerodicTask(Constants.BackgroundTask_Event);
|
||||
this.runningFeeds--;
|
||||
}
|
||||
|
||||
this.NotifyComplete();
|
||||
if (this.runningFeeds == 0)
|
||||
{
|
||||
this.NotifyComplete();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -318,18 +348,18 @@ namespace CampusAppWP8ScheduledTaskAgent
|
||||
int randomNumber = random.Next(0, mealCount);
|
||||
MealModel meal = this.mensaModel.Menus[dayIndex].Meals[randomNumber];
|
||||
data.WideContent3 = meal.MealName + ": " + DefaultStringManager.ToShortString(meal.MealDesc, 30, "...");
|
||||
data.Count = this.mensaModel.Menus[dayIndex].Meals.Count;
|
||||
// data.Count = this.mensaModel.Menus[dayIndex].Meals.Count;
|
||||
}
|
||||
}
|
||||
|
||||
tileToFind.Update(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
BackgroundTasks.StopPerodicTask(Constants.BackgroundTask_Mensa);
|
||||
this.runningFeeds--;
|
||||
}
|
||||
|
||||
this.NotifyComplete();
|
||||
if (this.runningFeeds == 0)
|
||||
{
|
||||
this.NotifyComplete();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -9,8 +9,8 @@ namespace CampusAppWPortalLib8.Model.Mensa
|
||||
{
|
||||
using System.Xml.Serialization;
|
||||
using CampusAppWPortalLib8.Resources;
|
||||
using CampusAppWPortalLib8.Utility;
|
||||
|
||||
using CampusAppWPortalLib8.Utility;
|
||||
|
||||
/// <summary>
|
||||
/// Model for a meal
|
||||
/// </summary>
|
||||
@@ -21,47 +21,47 @@ namespace CampusAppWPortalLib8.Model.Mensa
|
||||
/// <summary>
|
||||
/// Constant for the vegetarian icon
|
||||
/// </summary>
|
||||
private const string MealIconNameVegetarian = "CARROTTE";
|
||||
public const string MealIconNameVegetarian = "CARROTTE";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the free icon
|
||||
/// </summary>
|
||||
private const string MealIconNameFree = "FREI";
|
||||
public const string MealIconNameFree = "FREI";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the pig icon
|
||||
/// </summary>
|
||||
private const string MealIconNamePig = "SCHWEIN";
|
||||
public const string MealIconNamePig = "SCHWEIN";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the cow icon
|
||||
/// </summary>
|
||||
private const string MealIconNameCow = "RIND";
|
||||
public const string MealIconNameCow = "RIND";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the fowl icon
|
||||
/// </summary>
|
||||
private const string MealIconNameFowl = "GEFL";
|
||||
public const string MealIconNameFowl = "GEFL";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the cow-pig icon
|
||||
/// </summary>
|
||||
private const string MealIconNameCowPig = "RINDSCHWEIN";
|
||||
public const string MealIconNameCowPig = "RINDSCHWEIN";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the fish icon
|
||||
/// </summary>
|
||||
private const string MealIconNameFish = "FISCH";
|
||||
public const string MealIconNameFish = "FISCH";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the wild icon
|
||||
/// </summary>
|
||||
private const string MealIconNameWild = "WILD";
|
||||
public const string MealIconNameWild = "WILD";
|
||||
|
||||
/// <summary>
|
||||
/// Constant for the lamb icon
|
||||
/// </summary>
|
||||
private const string MealIconNameLamb = "LAMM";
|
||||
public const string MealIconNameLamb = "LAMM";
|
||||
|
||||
/// <summary>
|
||||
/// Variable for the id of the meal
|
||||
@@ -140,6 +140,17 @@ namespace CampusAppWPortalLib8.Model.Mensa
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the icon url
|
||||
/// </summary>
|
||||
public string IconUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the icon name
|
||||
/// </summary>
|
||||
[XmlAttribute("icon")]
|
||||
public string IconName { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.5 KiB |