Merge branch 'feature/#260' into develop

This commit is contained in:
stubbfel
2013-10-21 15:14:29 +02:00
30 changed files with 380 additions and 230 deletions

View File

@@ -63,7 +63,7 @@ namespace CampusAppWP8.Api.GeoApi
}
CampusAppWPortalLib8.Model.Settings.Campus campus;
foreach (PlaceModel place in this.Model.Places)
foreach (PlaceWp8Model place in this.Model.Places)
{
if (Enum.TryParse(place.PlaceId, true, out campus))
{

View File

@@ -18,7 +18,7 @@ namespace CampusAppWP8.Api.GeoApi
/// <summary> Pis api. </summary>
/// <remarks> Stubbfel, 09.09.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWP8.Model.GeoDb.SpsModel}"/>
public class PisApi : XmlModel<SpsModel>
public class PisApi : XmlModel<SpsWp8Model>
{
#region Constructor

View File

@@ -18,7 +18,7 @@ namespace CampusAppWP8.Api.GeoApi
/// <summary> Pss api. </summary>
/// <remarks> Stubbfel, 09.09.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWP8.Model.GeoDb.SpsModel}"/>
public class PssApi : XmlModel<SpsModel>
public class PssApi : XmlModel<SpsWp8Model>
{
#region Constructor

View File

@@ -19,7 +19,7 @@ namespace CampusAppWP8.Api.GeoApi
/// <summary> Class for SPSAPI. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWP8.Model.GeoDb.SpsModel}"/>
public class SpsApi : XmlModel<SpsModel>
public class SpsApi : XmlModel<SpsWp8Model>
{
#region Constructor

View File

@@ -128,12 +128,10 @@
<Compile Include="Model\Campusmap\SearchPlacePinModel.cs" />
<Compile Include="Model\Exams\ExamListWp8Model.cs" />
<Compile Include="Model\Exams\ExamWp8Model.cs" />
<Compile Include="Model\GeoDb\CampusBuildingLayerModel.cs" />
<Compile Include="Model\GeoDb\CampusBuildingModel.cs" />
<Compile Include="Model\GeoDb\PlaceInformation.cs" />
<Compile Include="Model\GeoDb\PlaceModel.cs" />
<Compile Include="Model\GeoDb\PlaceService.cs" />
<Compile Include="Model\GeoDb\SpsModel.cs" />
<Compile Include="Model\GeoDb\CampusBuildingLayerWp8Model.cs" />
<Compile Include="Model\GeoDb\CampusBuildingWp8Model.cs" />
<Compile Include="Model\GeoDb\PlaceWp8Model.cs" />
<Compile Include="Model\GeoDb\SpsWp8Model.cs" />
<Compile Include="Model\Person\PersonFunctionWp8Model.cs" />
<Compile Include="Model\Person\PersonListWp8Model.cs" />
<Compile Include="Model\Person\PersonWp8Model.cs" />

View File

@@ -16,7 +16,7 @@ namespace CampusAppWP8.File.Places
/// <summary> Places file. </summary>
/// <remarks> Stubbfel, 09.09.2013. </remarks>
/// <seealso cref="T:CampusAppWP8.Model.XmlModel{CampusAppWP8.Model.GeoDb.SpsModel}"/>
public class PlacesFile : XmlModel<SpsModel>
public class PlacesFile : XmlModel<SpsWp8Model>
{
#region Constructor
@@ -39,7 +39,7 @@ namespace CampusAppWP8.File.Places
/// <param name="model"> The model. </param>
/// <param name="fileInfo"> Information describing the file. </param>
/// <returns> true if it succeeds, false if it fails. </returns>
private bool CheckIsFileUpToDate(SpsModel model, System.IO.FileInfo fileInfo)
private bool CheckIsFileUpToDate(SpsWp8Model model, System.IO.FileInfo fileInfo)
{
if (fileInfo == null || !fileInfo.Exists || fileInfo.Length < 1 || (model != null && model.HasChanged))
{
@@ -53,7 +53,7 @@ namespace CampusAppWP8.File.Places
/// <remarks> Stubbfel, 14.10.2013. </remarks>
public void FallBackLoad()
{
SpsModel fallBackModel = XmlManager.DeserializationFileToModel<SpsModel>(Constants.FileMap_OfflineMap);
SpsWp8Model fallBackModel = XmlManager.DeserializationFileToModel<SpsWp8Model>(Constants.FileMap_OfflineMap);
this.Model = fallBackModel;
this.SaveData();
}

View File

@@ -25,8 +25,8 @@ namespace CampusAppWP8.Model.Campusmap
/// <param name="id"> The identifier. </param>
public BuildingMapModel(string id)
{
SpsModel buildings = XmlManager.DeserializationFileToModel<SpsModel>(Constants.FileMap_BuildingsMap);
PlaceModel building = buildings.GetPlaceById(id);
SpsWp8Model buildings = XmlManager.DeserializationFileToModel<SpsWp8Model>(Constants.FileMap_BuildingsMap);
PlaceWp8Model building = buildings.GetPlaceById(id);
if (buildings == null)
{
return;

View File

@@ -30,7 +30,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary> Initializes a new instance of the <see cref="CBMainMapModel" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="placeList"> List of places. </param>
public CBMainMapModel(List<PlaceModel> placeList)
public CBMainMapModel(List<PlaceWp8Model> placeList)
: base(placeList, CBMainMapModel.Campus)
{
this.ImageSource = Constants.FileMap_CBMainMap;

View File

@@ -22,7 +22,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="placeList"> list of places. </param>
/// <param name="campusId"> id of the campus. </param>
public CampusMapModel(List<PlaceModel> placeList, string campusId)
public CampusMapModel(List<PlaceWp8Model> placeList, string campusId)
{
this.CampusId = campusId;
this.LoadSpatials(placeList);
@@ -50,12 +50,12 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary> Loads the spatial./. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <seealso cref="M:CampusAppWP8.Model.Campusmap.MapModel.LoadSpatials(List{PlaceModel})"/>
protected override void LoadSpatials(List<PlaceModel> placeList)
protected override void LoadSpatials(List<PlaceWp8Model> placeList)
{
List<PlaceModel> campusPlaces = new List<PlaceModel>();
this.Spatial = new SpsModel();
List<PlaceWp8Model> campusPlaces = new List<PlaceWp8Model>();
this.Spatial = new SpsWp8Model();
foreach (PlaceModel place in placeList)
foreach (PlaceWp8Model place in placeList)
{
if (place.ParentId.Equals(this.CampusId) || place.PlaceId.Equals(this.CampusId))
{

View File

@@ -24,7 +24,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary> Gets or sets place which are associative with this pin. </summary>
/// <value> The associated places. </value>
public List<PlaceModel> AssocPlaces { get; set; }
public List<PlaceWp8Model> AssocPlaces { get; set; }
#endregion

View File

@@ -32,7 +32,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary> Initializes a new instance of the <see cref="MapModel" /> class. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="placeList"> list of places. </param>
public MapModel(List<PlaceModel> placeList)
public MapModel(List<PlaceWp8Model> placeList)
{
this.IsReady = false;
this.LoadSpatials(placeList);
@@ -46,7 +46,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary> Delegate for MapInfo. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="places"> list of places. </param>
public delegate void MapInfos(List<PlaceModel> places);
public delegate void MapInfos(List<PlaceWp8Model> places);
/// <summary> Event ShowMapInfo. </summary>
public event MapInfos ShowMapInfos = null;
@@ -100,7 +100,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary> Gets or sets the spatial of the map. </summary>
/// <value> The spatial. </value>
public SpsModel Spatial { get; set; }
public SpsWp8Model Spatial { get; set; }
#endregion
@@ -137,7 +137,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <param name="type"> The type. </param>
/// <param name="places"> (Optional) list of places. </param>
/// <returns> image of the pin. </returns>
public Image AddPin(double x, double y, MapPinModel.PinType type, List<PlaceModel> places = null)
public Image AddPin(double x, double y, MapPinModel.PinType type, List<PlaceWp8Model> places = null)
{
Point position = new Point(x, y);
return this.AddPin(position, type, places);
@@ -153,7 +153,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <param name="type"> The type. </param>
/// <param name="places"> (Optional) list of places. </param>
/// <returns> image of the pin. </returns>
public Image AddPinFromRefPoint(double x, double y, MapPinModel.PinType type, List<PlaceModel> places = null)
public Image AddPinFromRefPoint(double x, double y, MapPinModel.PinType type, List<PlaceWp8Model> places = null)
{
Point position = new Point(this.RefPoint.X + x, this.RefPoint.Y - y);
return this.AddPin(position, type, places);
@@ -168,7 +168,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <param name="type"> The type. </param>
/// <param name="places"> (Optional) list of places. </param>
/// <returns> image of the pin. </returns>
public Image AddPinFromRefPoint(Point position, MapPinModel.PinType type, List<PlaceModel> places = null)
public Image AddPinFromRefPoint(Point position, MapPinModel.PinType type, List<PlaceWp8Model> places = null)
{
return this.AddPinFromRefPoint(position.X, position.Y, type, places);
}
@@ -179,7 +179,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <param name="type"> The type. </param>
/// <param name="places"> (Optional) list of places. </param>
/// <returns> image of the pin. </returns>
public Image AddPin(Point position, MapPinModel.PinType type, List<PlaceModel> places = null)
public Image AddPin(Point position, MapPinModel.PinType type, List<PlaceWp8Model> places = null)
{
Image pinImg = new Image();
MapPinModel pin = this.CreatePin(type, places, pinImg);
@@ -243,9 +243,9 @@ namespace CampusAppWP8.Model.Campusmap
/// <summary> Loads the spatial object </summary>
/// <remarks> Stubbfel, 19.08.2013. </remarks>
/// <param name="placeList"> list of places. </param>
protected virtual void LoadSpatials(List<PlaceModel> placeList)
protected virtual void LoadSpatials(List<PlaceWp8Model> placeList)
{
this.Spatial = new SpsModel();
this.Spatial = new SpsWp8Model();
this.Spatial.AddPlaces(placeList);
}
@@ -259,7 +259,7 @@ namespace CampusAppWP8.Model.Campusmap
/// <param name="places"> list of places. </param>
/// <param name="pinImg"> image of the pin. </param>
/// <returns> The new pin. </returns>
private MapPinModel CreatePin(MapPinModel.PinType type, List<PlaceModel> places, Image pinImg)
private MapPinModel CreatePin(MapPinModel.PinType type, List<PlaceWp8Model> places, Image pinImg)
{
MapPinModel pin;
switch (type)

View File

@@ -1,55 +0,0 @@
//-----------------------------------------------------------------------
// <copyright file="CampusBuildingLayerModel.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>15.10.2013</date>
// <summary>Implements the campus building layer model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
{
using System.Collections.Generic;
using CampusAppWP8.Resources;
/// <summary> Class is model for buildings of a campus. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public class CampusBuildingLayerModel
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="CampusBuildingLayerModel" /> class.
/// </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <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>
/// <value> The rooms. </value>
public SpsModel Rooms { get; set; }
/// <summary> Gets or sets LayerId. </summary>
/// <value> The identifier of the layer. </value>
public string LayerId { get; set; }
#endregion
}
}

View File

@@ -0,0 +1,17 @@
//-----------------------------------------------------------------------
// <copyright file="CampusBuildingLayerWp8Model.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>21.10.2013</date>
// <summary>Implements the campus building layer wp 8 model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
{
/// <summary> A data Model for the campus building layer wp 8. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
/// <seealso cref="T:CampusAppWPortalLib8.Model.GeoDb.CampusBuildingLayerModel{CampusAppWP8.Model.GeoDb.PlaceWp8Model}"/>
public class CampusBuildingLayerWp8Model : CampusAppWPortalLib8.Model.GeoDb.CampusBuildingLayerModel<PlaceWp8Model>
{
}
}

View File

@@ -0,0 +1,27 @@
//-----------------------------------------------------------------------
// <copyright file="CampusBuildingWp8Model.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>21.10.2013</date>
// <summary>Implements the campus building model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
{
using System.Collections.Generic;
/// <summary> A data Model for the campus building. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
/// <seealso cref="T:CampusAppWPortalLib8.Model.GeoDb.CampusBuildingModel{CampusAppWP8.Model.GeoDb.CampusBuildingLayerWp8Model,CampusAppWP8.Model.GeoDb.PlaceWp8Model}"/>
public class CampusBuildingWp8Model : CampusAppWPortalLib8.Model.GeoDb.CampusBuildingModel<CampusBuildingLayerWp8Model, PlaceWp8Model>
{
/// <summary> Initializes a new instance of the CampusBuildingWp8Model class. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
/// <param name="buildingId"> Identifier for the building. </param>
/// <param name="places"> The places. </param>
public CampusBuildingWp8Model(string buildingId, List<PlaceWp8Model> places)
: base(buildingId, places)
{
}
}
}

View File

@@ -0,0 +1,62 @@
//-----------------------------------------------------------------------
// <copyright file="PlaceWp8Model.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>21.10.2013</date>
// <summary>Implements the place wp 8 model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
{
using System;
using System.Device.Location;
using System.Globalization;
using System.Text.RegularExpressions;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Utility;
/// <summary> Model for a place of the SPSService. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <seealso cref="T:CampusAppWPortalLib8.Model.GeoDb.PlaceModel"/>
/// <seealso cref="T:System.IEquatable{CampusAppWP8.Model.GeoDb.PlaceModel}"/>
public class PlaceWp8Model : CampusAppWPortalLib8.Model.GeoDb.PlaceModel
{
#region Property
/// <summary> Gets the geo reference point. </summary>
/// <value> The geo reference point. </value>
public GeoCoordinate GeoRefPoint
{
get
{
string refstring = this.RefPoint;
Regex rx = new Regex(Constants.Regex_Coordinate);
MatchCollection matches = rx.Matches(refstring);
if (matches.Count != 1)
{
return null;
}
string[] values = matches[0].ToString().Split(' ');
if (values.Length != 2)
{
return null;
}
// create the GeoCoordirate
try
{
return new GeoCoordinate(double.Parse(values[1], CultureInfo.InvariantCulture), double.Parse(values[0], CultureInfo.InvariantCulture));
}
catch (Exception ex)
{
Logger.LogException(ex);
return null;
}
}
}
#endregion
}
}

View File

@@ -0,0 +1,20 @@
//-----------------------------------------------------------------------
// <copyright file="SpsWp8Model.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>21.10.2013</date>
// <summary>Implements the sps wp 8 model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
{
using System.Xml.Serialization;
/// <summary> A data Model for the sps wp 8. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
/// <seealso cref="T:CampusAppWPortalLib8.Model.GeoDb.SpsModel{CampusAppWP8.Model.GeoDb.PlaceWp8Model}"/>
[XmlRoot("root")]
public class SpsWp8Model : CampusAppWPortalLib8.Model.GeoDb.SpsModel<PlaceWp8Model>
{
}
}

View File

@@ -19,7 +19,6 @@ namespace CampusAppWP8.Pages.Campusmap
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Navigation;
using Windows.Networking.Proximity;
using CampusAppWP8.File.Places;
using CampusAppWP8.Model.Campusmap;
using CampusAppWP8.Model.GeoDb;
@@ -29,6 +28,7 @@ namespace CampusAppWP8.Pages.Campusmap
using CampusAppWP8.Utility.NDEF;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Windows.Networking.Proximity;
/// <summary> Class for the campusMap page. </summary>
/// <remarks> Stubbfel, 19.08.2013. </remarks>
@@ -138,7 +138,7 @@ namespace CampusAppWP8.Pages.Campusmap
scroll = false;
if (Utilities.IsRoomId(alias))
{
PlaceModel place = this.file.Model.GetPlaceById(alias);
PlaceWp8Model place = this.file.Model.GetPlaceById(alias);
if (place != null)
{
this.GoToRoomList(place.ParentId, place.PlaceId);
@@ -159,12 +159,11 @@ namespace CampusAppWP8.Pages.Campusmap
App.SaveToIsolatedStorage<string>(Constants.CampusMapApp_QRCodeSearchResultStorageKey, null);
string searchPid = Wp8StringManager.FilterPlaceIdinQRResultString(qrcodeResult);
PlaceModel place = this.file.Model.GetPlaceById(searchPid);
PlaceWp8Model place = this.file.Model.GetPlaceById(searchPid);
if (searchPid != null)
{
//this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
// this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
if (place.ParentId.Equals(this.campusMap.CampusId) || place.PlaceId.Equals(this.campusMap.CampusId))
{
this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
@@ -176,7 +175,7 @@ namespace CampusAppWP8.Pages.Campusmap
}
}
ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
}
/// <summary> Methods overrides the OnNavigatedFrom-Method. </summary>
@@ -184,12 +183,11 @@ namespace CampusAppWP8.Pages.Campusmap
/// <seealso cref="M:System.Windows.Controls.Page.OnNavigatedFrom(NavigationEventArgs)"/>
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
this.device.StopSubscribingForMessage(ndefId);
this.device.StopSubscribingForMessage(this.ndefId);
base.OnNavigatedFrom(e);
}
#endregion
#region private
@@ -431,9 +429,9 @@ namespace CampusAppWP8.Pages.Campusmap
return;
}
List<PlaceModel> placeList = new List<PlaceModel>();
PlaceModel tmpPlace;
SpsModel spatial;
List<PlaceWp8Model> placeList = new List<PlaceWp8Model>();
PlaceWp8Model tmpPlace;
SpsWp8Model spatial;
if (allPlaces)
{
spatial = this.file.Model;
@@ -466,6 +464,7 @@ namespace CampusAppWP8.Pages.Campusmap
private void SearchPlaceByNFC_Click(object sender, EventArgs e)
{
MessageBoxes.ShowMainModelInfoMessageBox(AppResources.ScarNfc_Search);
// this.DefHeader.ProgressVisibility = Visibility.Visible;
// this.device.StopSubscribingForMessage(this.ndefId);
// this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
@@ -499,7 +498,7 @@ namespace CampusAppWP8.Pages.Campusmap
// search for placeId
string nfcContent = ndef.GetContent();
string searchPid = Wp8StringManager.FilterPlaceIdinNFCResultString(nfcContent.Trim());
PlaceModel place = this.file.Model.GetPlaceById(searchPid);
PlaceWp8Model place = this.file.Model.GetPlaceById(searchPid);
if (searchPid != null)
{
@@ -517,7 +516,7 @@ namespace CampusAppWP8.Pages.Campusmap
}
else
{
//this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
// this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
if (place.ParentId.Equals(this.campusMap.CampusId))
{
this.ShowAllPlacesByPlaceIdAsSearchPin(searchPid);
@@ -549,9 +548,8 @@ namespace CampusAppWP8.Pages.Campusmap
{
this.DefHeader.ProgressVisibility = Visibility.Collapsed;
}
ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
this.ndefId = this.device.SubscribeForMessage(Constants.NCFMessageType_NDEF, this.NDEFHandler);
}
/// <summary> Searches for the first places. </summary>
@@ -561,9 +559,9 @@ namespace CampusAppWP8.Pages.Campusmap
/// (optional) if its true, search places in place file, otherwise in CampusMapModel.
/// </param>
/// <returns> The found places. </returns>
private List<PlaceModel> SearchPlaces(string query, bool allPlaces = false)
private List<PlaceWp8Model> SearchPlaces(string query, bool allPlaces = false)
{
SpsModel spatial;
SpsWp8Model spatial;
if (allPlaces)
{
spatial = this.file.Model;
@@ -576,7 +574,7 @@ namespace CampusAppWP8.Pages.Campusmap
// if query is an id
if (Wp8StringManager.IsDigitsOnly(query))
{
return new List<PlaceModel>() { spatial.GetPlaceById(query) };
return new List<PlaceWp8Model>() { spatial.GetPlaceById(query) };
}
if (this.informationsNames == null)
@@ -595,9 +593,9 @@ namespace CampusAppWP8.Pages.Campusmap
/// <param name="places"> The places. </param>
/// <param name="type"> The type. </param>
/// <param name="scroll"> (Optional) the scroll. </param>
private void AddPins(List<PlaceModel> places, MapPinModel.PinType type, bool scroll = true)
private void AddPins(List<PlaceWp8Model> places, MapPinModel.PinType type, bool scroll = true)
{
foreach (PlaceModel place in places)
foreach (PlaceWp8Model place in places)
{
if (place == null)
{
@@ -607,7 +605,7 @@ namespace CampusAppWP8.Pages.Campusmap
GeoCoordinate coor = place.GeoRefPoint;
if (coor != null)
{
List<PlaceModel> assocPlaces = new List<PlaceModel>();
List<PlaceWp8Model> assocPlaces = new List<PlaceWp8Model>();
assocPlaces.Add(place);
this.AddPin(coor.Longitude, coor.Latitude, type, scroll, assocPlaces);
}
@@ -623,7 +621,7 @@ 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)
private void AddPin(double x, double y, MapPinModel.PinType type, bool scroll = true, List<PlaceWp8Model> assocPlaces = null)
{
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));
@@ -648,6 +646,7 @@ namespace CampusAppWP8.Pages.Campusmap
{
scrollPoint.Y = 0;
}
MapScroller.ScrollToVerticalOffset(scrollPoint.Y);
MapScroller.ScrollToHorizontalOffset(scrollPoint.X);
}
@@ -748,7 +747,7 @@ namespace CampusAppWP8.Pages.Campusmap
/// <summary> Method show same PlaceInformation. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="places"> List of places. </param>
private void ShowMapInfo(List<PlaceModel> places)
private void ShowMapInfo(List<PlaceWp8Model> places)
{
if (places == null)
{
@@ -756,7 +755,7 @@ namespace CampusAppWP8.Pages.Campusmap
}
string msgText = string.Empty;
foreach (PlaceModel place in places)
foreach (PlaceWp8Model place in places)
{
msgText += AppResources.PlaceLabel_Name + ": ";
msgText += place.GetInformationsValue(Constants.PisInformationName_Name);
@@ -789,7 +788,7 @@ namespace CampusAppWP8.Pages.Campusmap
MessageBoxes.ShowMainModelInfoMessageBox(msgText);
foreach (PlaceModel place in places)
foreach (PlaceWp8Model place in places)
{
if (place.ParentId.Equals(this.campusMap.CampusId) && this.HasRooms(place.PlaceId))
{
@@ -817,6 +816,7 @@ namespace CampusAppWP8.Pages.Campusmap
{
urlString += "&" + Constants.ParamRoomId + "=" + roomId;
}
Uri url = new Uri(urlString as string, UriKind.Relative);
this.NavigationService.Navigate(url);
}
@@ -827,7 +827,7 @@ namespace CampusAppWP8.Pages.Campusmap
/// <returns> true, if the place has got rooms, otherwise false. </returns>
private bool HasRooms(string placeId)
{
foreach (PlaceModel place in this.file.Model.Places)
foreach (PlaceWp8Model place in this.file.Model.Places)
{
if (place.ParentId.Equals(placeId))
{
@@ -848,9 +848,9 @@ namespace CampusAppWP8.Pages.Campusmap
{
this.SearchByText(sender, e);
this.MapScroller.Focus();
}
}
}
#endregion
#endregion

View File

@@ -34,7 +34,7 @@ namespace CampusAppWP8.Pages.Campusmap
private PlacesFile placeFile;
/// <summary> Variable of building which is shown in the list. </summary>
private CampusBuildingModel building;
private CampusBuildingWp8Model building;
/// <summary> Variable for the map model. </summary>
private BuildingMapModel buildingMap;
@@ -149,20 +149,20 @@ namespace CampusAppWP8.Pages.Campusmap
this.ClearMap(new List<string>() { MapPinModel.InfoPlacePinString });
PlaceModel room = this.building.GetPlaceById(placeId);
PlaceWp8Model room = this.building.GetPlaceById(placeId);
x = room.GeoRefPoint.Longitude;
y = room.GeoRefPoint.Latitude;
Point roompoint = this.buildingMap.GetScrollPoint(this.buildingMap.ConverToPixelPoint(this.buildingMap.ConverToMapPoint(x, y)));
Point viewPoint = new Point(roompoint.X - this.mappoint.X + this.offsetPoint.X, roompoint.Y - this.mappoint.Y + this.offsetPoint.Y);
MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, MapPinModel.PinType.InfoRedPlace, new List<PlaceModel> { room }));
MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, MapPinModel.PinType.InfoRedPlace, new List<PlaceWp8Model> { room }));
}
/// <summary> Shows the map information. </summary>
/// <remarks> Stubbfel, 14.10.2013. </remarks>
/// <param name="places"> The places. </param>
private void ShowMapInfo(List<PlaceModel> places)
private void ShowMapInfo(List<PlaceWp8Model> places)
{
if (this.pinchRun)
{
@@ -175,7 +175,7 @@ namespace CampusAppWP8.Pages.Campusmap
return;
}
foreach (PlaceModel place in places)
foreach (PlaceWp8Model place in places)
{
msgText += AppResources.PlaceLabel_Name + ": ";
msgText += place.GetInformationsValue(Constants.PisInformationName_Name);
@@ -288,13 +288,13 @@ namespace CampusAppWP8.Pages.Campusmap
layerKey = this.building.Layers.Keys.First();
}
CampusBuildingLayerModel layer = this.building.Layers[layerKey];
CampusBuildingLayerWp8Model layer = this.building.Layers[layerKey];
double x;
double y;
this.ClearMap(new List<string>() { MapPinModel.InfoPlacePinString });
foreach (PlaceModel room in layer.Rooms.Places)
foreach (PlaceWp8Model room in layer.Rooms.Places)
{
x = room.GeoRefPoint.Longitude;
y = room.GeoRefPoint.Latitude;
@@ -321,7 +321,7 @@ namespace CampusAppWP8.Pages.Campusmap
break;
}
MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, type, new List<PlaceModel> { room }));
MapCanvas.Children.Add(this.buildingMap.AddPin(viewPoint, type, new List<PlaceWp8Model> { room }));
}
// MapCanvas.Children.Add(this.buildingMap.AddPin(offsetPoint, MapPinModel.PinType.SearchPlace));
@@ -341,7 +341,7 @@ namespace CampusAppWP8.Pages.Campusmap
/// <param name="buildingId"> Identifier for the building. </param>
private void SetupCanvas(string buildingId)
{
this.building = new CampusBuildingModel(buildingId, this.placeFile.Model.Places.ToList());
this.building = new CampusBuildingWp8Model(buildingId, this.placeFile.Model.Places.ToList());
this.buildingMap = new BuildingMapModel(this.building.Building.PlaceId);
this.buildingMap.ShowMapInfos += new CBMainMapModel.MapInfos(this.ShowMapInfo);

View File

@@ -85,7 +85,7 @@ namespace CampusAppWP8.Pages.Dev
this.ndefList = new List<NDEFMessage>();
// MapModel map = new CBMainMapModel(this.file.Model.Places.ToList());
foreach (PlaceModel place in this.file.Model.Places.ToList())
foreach (PlaceWp8Model place in this.file.Model.Places.ToList())
{
this.ndefList.Add(new NDEFMessage(place.ToNfcString(), NDEFMessage.TYPEVAL.TEXT));
}

View File

@@ -90,7 +90,7 @@ namespace CampusAppWP8.Pages.PlaceNews
if (this.places == null)
{
this.places = new PlacesFile();
this.places.Model = App.LoadFromIsolatedStorage<SpsModel>(Constants.IsolatedStorage_AllPlaces);
this.places.Model = App.LoadFromIsolatedStorage<SpsWp8Model>(Constants.IsolatedStorage_AllPlaces);
}
if (this.qrScan)
@@ -131,7 +131,7 @@ namespace CampusAppWP8.Pages.PlaceNews
{
if (NavigationMode.Back == e.NavigationMode)
{
App.SaveToIsolatedStorage<SpsModel>(Constants.IsolatedStorage_AllPlaces, null);
App.SaveToIsolatedStorage<SpsWp8Model>(Constants.IsolatedStorage_AllPlaces, null);
}
}
@@ -199,7 +199,7 @@ namespace CampusAppWP8.Pages.PlaceNews
/// <remarks> Stubbfel, 09.09.2013. </remarks>
private void PlacesFileIsFail()
{
this.places.Model = new SpsModel();
this.places.Model = new SpsWp8Model();
if (this.spsApi == null)
{
this.spsApi = new SpsApi();
@@ -328,7 +328,7 @@ namespace CampusAppWP8.Pages.PlaceNews
this.ResultBox.ItemsSource = this.places.Model.FilterByPid(this.searchPidList);
this.ProgressBar.Visibility = Visibility.Collapsed;
this.places.SaveData();
App.SaveToIsolatedStorage<SpsModel>(Constants.IsolatedStorage_AllPlaces, this.places.Model);
App.SaveToIsolatedStorage<SpsWp8Model>(Constants.IsolatedStorage_AllPlaces, this.places.Model);
this.forceRequest = false;
}
@@ -412,7 +412,7 @@ namespace CampusAppWP8.Pages.PlaceNews
return;
}
PlaceModel place = this.places.Model.GetPlaceById(placeID);
PlaceWp8Model place = this.places.Model.GetPlaceById(placeID);
txt.Text = place.GetInformationsValue(Constants.PisInformationName_Name);
}

View File

@@ -39,9 +39,9 @@ namespace CampusAppWP8.Pages.PlaceNews
{
if (NavigationContext.QueryString.ContainsKey(Constants.ParamPlaceID))
{
SpsModel model = App.LoadFromIsolatedStorage<SpsModel>(Constants.IsolatedStorage_AllPlaces);
SpsWp8Model model = App.LoadFromIsolatedStorage<SpsWp8Model>(Constants.IsolatedStorage_AllPlaces);
string placeId = NavigationContext.QueryString[Constants.ParamPlaceID];
PlaceModel place = model.GetPlaceById(placeId);
PlaceWp8Model place = model.GetPlaceById(placeId);
if (place != null && place.Services != null && place.Services.Count > 0 && place.Informations != null && place.Informations.Count > 0)
{
this.Room.Text += " - " + place.Informations[0].InformationValue;

View File

@@ -39,6 +39,12 @@
<Compile Include="Model\Exams\ExamListModel.cs" />
<Compile Include="Model\Exams\ExamModel.cs" />
<Compile Include="Model\ForcesTypes.cs" />
<Compile Include="Model\GeoDb\CampusBuildingLayerModel.cs" />
<Compile Include="Model\GeoDb\CampusBuildingModel.cs" />
<Compile Include="Model\GeoDb\PlaceInformation.cs" />
<Compile Include="Model\GeoDb\PlaceModel.cs" />
<Compile Include="Model\GeoDb\PlaceService.cs" />
<Compile Include="Model\GeoDb\SpsModel.cs" />
<Compile Include="Model\Lecture\LectureActivity.cs" />
<Compile Include="Model\Lecture\LectureCourse.cs" />
<Compile Include="Model\Lecture\LectureDate.cs" />

View File

@@ -0,0 +1,75 @@
//-----------------------------------------------------------------------
// <copyright file="CampusBuildingLayerModel.cs" company="BTU/IIT">
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
// </copyright>
// <author>Stubbfel</author>
// <date>15.10.2013</date>
// <summary>Implements the campus building layer model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.GeoDb
{
using System.Collections.Generic;
using CampusAppWPortalLib8.Resources;
/// <summary> A data Model for the campus building layer. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
/// <typeparam name="V"> Generic type parameter. PlaceModel </typeparam>
public class CampusBuildingLayerModel<V> where V : PlaceModel
{
#region Constructor
/// <summary> Initializes a new instance of the CampusBuildingLayerModel class. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
public CampusBuildingLayerModel()
{
}
/// <summary> Initializes a new instance of the CampusBuildingLayerModel class. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
/// <param name="layerId"> The identifier of the layer. </param>
/// <param name="places"> list of place which can be room of the layer. </param>
public CampusBuildingLayerModel(string layerId, List<V> places)
{
this.LayerId = layerId;
this.AddsRooms(places);
}
#endregion
#region property
/// <summary> Gets or sets Rooms. </summary>
/// <value> The rooms. </value>
public SpsModel<V> Rooms { get; set; }
/// <summary> Gets or sets LayerId. </summary>
/// <value> The identifier of the layer. </value>
public string LayerId { get; set; }
#endregion
#region Method
/// <summary> Adds rooms. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
/// <param name="places"> list of place which can be room of the layer. </param>
public void AddsRooms(List<V> places)
{
if (this.Rooms == null)
{
this.Rooms = new SpsModel<V>();
}
foreach (V place in places)
{
string placeLayerId = place.GetInformationsValue(Constants.PisInformationName_Layer);
if (placeLayerId != null && placeLayerId.Equals(this.LayerId))
{
this.Rooms.Places.Add(place);
}
}
}
#endregion
}
}

View File

@@ -6,30 +6,71 @@
// <date>15.10.2013</date>
// <summary>Implements the campus building model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
namespace CampusAppWPortalLib8.Model.GeoDb
{
using System.Collections.Generic;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Resources;
/// <summary> Class is model for buildings of a campus. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public class CampusBuildingModel
/// <typeparam name="T"> Generic type parameter. CampusBuildingLayerModel </typeparam>
/// <typeparam name="V"> Generic type parameter. PlaceModel </typeparam>
public class CampusBuildingModel<T, V>
where V : PlaceModel
where T : CampusBuildingLayerModel<V>, new()
{
#region constructor
/// <summary>
/// Initializes a new instance of the <see cref="CampusBuildingModel" /> class.
/// </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <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)
/// <summary> Initializes a new instance of the CampusBuildingModel class. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
public CampusBuildingModel()
{
this.Layers = new Dictionary<string, CampusBuildingLayerModel>();
}
foreach (PlaceModel place in places)
/// <summary> Initializes a new instance of the CampusBuildingModel class. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
/// <param name="buildingId"> The identifier of the building. </param>
/// <param name="places"> list of place which can be room of the buildings. </param>
public CampusBuildingModel(string buildingId, List<V> places)
{
this.BuildingId = buildingId;
this.AddLayers(places);
}
#endregion
#region Property
/// <summary> Gets the Layer of the building. </summary>
/// <value> The layers. </value>
public Dictionary<string, T> Layers { get; private set; }
/// <summary> Gets or sets the Building V. </summary>
/// <value> The building. </value>
public V Building { get; set; }
/// <summary> Gets or sets the identifier of the building. </summary>
/// <value> The identifier of the building. </value>
public string BuildingId { get; set; }
#endregion
#region method
/// <summary> Adds the layers. </summary>
/// <remarks> Stubbfel, 21.10.2013. </remarks>
/// <param name="places"> list of place which can be room of the buildings. </param>
public void AddLayers(List<V> places)
{
if (this.Layers == null)
{
if (place.ParentId.Equals(buildingId))
this.Layers = new Dictionary<string, T>();
}
foreach (V place in places)
{
if (place.ParentId.Equals(this.BuildingId))
{
string placeLayerId = place.GetInformationsValue(Constants.PisInformationName_Layer);
if (placeLayerId == null)
@@ -43,40 +84,26 @@ namespace CampusAppWP8.Model.GeoDb
}
else
{
this.Layers.Add(placeLayerId, new CampusBuildingLayerModel(placeLayerId, new List<PlaceModel>() { place }));
T layer = new T() { LayerId = placeLayerId };
layer.AddsRooms(new List<V> { place });
this.Layers.Add(placeLayerId, layer);
}
}
else if (place.PlaceId.Equals(buildingId))
else if (place.PlaceId.Equals(this.BuildingId))
{
this.Building = place;
}
}
}
#endregion
#region Property
/// <summary> Gets the Layer of the building. </summary>
/// <value> The layers. </value>
public Dictionary<string, CampusBuildingLayerModel> Layers { get; private set; }
/// <summary> Gets or sets the Building PlaceModel. </summary>
/// <value> The building. </value>
public PlaceModel Building { get; set; }
#endregion
#region method
/// <summary> Method gets a place by their placeID. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <param name="placeID"> the placeId of the place. </param>
/// <returns> The place by identifier. </returns>
public PlaceModel GetPlaceById(string placeID)
public V GetPlaceById(string placeID)
{
PlaceModel result = null;
foreach (CampusBuildingLayerModel layer in this.Layers.Values)
V result = null;
foreach (T layer in this.Layers.Values)
{
result = layer.Rooms.GetPlaceById(placeID);
if (result != null)
@@ -94,13 +121,12 @@ namespace CampusAppWP8.Model.GeoDb
/// <returns> The layer key. </returns>
public string GetLayerKey(string placeId)
{
PlaceModel tmpPlace = null;
foreach (CampusBuildingLayerModel layer in this.Layers.Values)
V tmpPlace = null;
foreach (T layer in this.Layers.Values)
{
tmpPlace = layer.Rooms.GetPlaceById(placeId);
if (tmpPlace != null)
{
return layer.LayerId;
}
}

View File

@@ -6,7 +6,7 @@
// <date>15.10.2013</date>
// <summary>Implements the place information class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
namespace CampusAppWPortalLib8.Model.GeoDb
{
using System;
using System.Xml.Serialization;

View File

@@ -6,17 +6,12 @@
// <date>15.10.2013</date>
// <summary>Implements the place model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
namespace CampusAppWPortalLib8.Model.GeoDb
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Device.Location;
using System.Globalization;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using CampusAppWP8.Resources;
using CampusAppWPortalLib8.Utility;
/// <summary> Model for a place of the SPSService. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
@@ -40,40 +35,6 @@ namespace CampusAppWP8.Model.GeoDb
[XmlAttribute("refpoint")]
public string RefPoint { get; set; }
/// <summary> Gets the geo reference point. </summary>
/// <value> The geo reference point. </value>
public GeoCoordinate GeoRefPoint
{
get
{
string refstring = this.RefPoint;
Regex rx = new Regex(Constants.Regex_Coordinate);
MatchCollection matches = rx.Matches(refstring);
if (matches.Count != 1)
{
return null;
}
string[] values = matches[0].ToString().Split(' ');
if (values.Length != 2)
{
return null;
}
// create the GeoCoordirate
try
{
return new GeoCoordinate(double.Parse(values[1], CultureInfo.InvariantCulture), double.Parse(values[0], CultureInfo.InvariantCulture));
}
catch (Exception ex)
{
Logger.LogException(ex);
return null;
}
}
}
/// <summary> Gets or sets the information. </summary>
/// <value> The information. </value>
[XmlElement("placeInformation")]

View File

@@ -6,7 +6,7 @@
// <date>15.10.2013</date>
// <summary>Implements the place service class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
namespace CampusAppWPortalLib8.Model.GeoDb
{
using System;
using System.Xml.Serialization;

View File

@@ -6,7 +6,7 @@
// <date>15.10.2013</date>
// <summary>Implements the sps model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWP8.Model.GeoDb
namespace CampusAppWPortalLib8.Model.GeoDb
{
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -15,8 +15,9 @@ namespace CampusAppWP8.Model.GeoDb
/// <summary> Model for a xml-response of the SPSService. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <typeparam name="T"> Generic type parameter. </typeparam>
[XmlRoot("root")]
public class SpsModel
public class SpsModel<T> where T : PlaceModel
{
#region Constructor
@@ -25,7 +26,7 @@ namespace CampusAppWP8.Model.GeoDb
public SpsModel()
{
this.HasChanged = false;
this.Places = new ObservableCollection<PlaceModel>();
this.Places = new ObservableCollection<T>();
}
#endregion
@@ -35,7 +36,7 @@ namespace CampusAppWP8.Model.GeoDb
/// <summary> Gets or sets a list of places. </summary>
/// <value> The places. </value>
[XmlElement("place")]
public ObservableCollection<PlaceModel> Places { get; set; }
public ObservableCollection<T> Places { get; set; }
/// <summary> Gets or sets a value indicating whether this object has changed. </summary>
/// <value> true if this object has changed, false if not. </value>
@@ -53,12 +54,12 @@ namespace CampusAppWP8.Model.GeoDb
/// <param name="ignoreCases"> (Optional) the ignore cases. </param>
/// <param name="informationNames"> (Optional) name of the information. </param>
/// <returns> The places by information. </returns>
public List<PlaceModel> GetPlacesByInformation(string query, bool ignoreCases = true, List<string> informationNames = null)
public List<T> GetPlacesByInformation(string query, bool ignoreCases = true, List<string> informationNames = null)
{
string querryStr = string.Empty;
List<PlaceModel> resultplaces = new List<PlaceModel>();
List<T> resultplaces = new List<T>();
foreach (PlaceModel place in this.Places)
foreach (T place in this.Places)
{
if (this.IsPlaceQueryMatched(place, query, ignoreCases, informationNames))
{
@@ -72,9 +73,9 @@ namespace CampusAppWP8.Model.GeoDb
/// <summary> Adds the places. </summary>
/// <remarks> Stubbfel, 09.09.2013. </remarks>
/// <param name="places"> A list of places. </param>
public void AddPlaces(List<PlaceModel> places)
public void AddPlaces(List<T> places)
{
foreach (PlaceModel place in places)
foreach (T place in places)
{
if (this.Places.Contains(place))
{
@@ -97,7 +98,7 @@ namespace CampusAppWP8.Model.GeoDb
public List<string> CreatePidList()
{
List<string> pidList = new List<string>();
foreach (PlaceModel place in this.Places)
foreach (T place in this.Places)
{
pidList.Add(place.PlaceId);
}
@@ -109,9 +110,9 @@ namespace CampusAppWP8.Model.GeoDb
/// <remarks> Stubbfel, 09.09.2013. </remarks>
/// <param name="id"> The identifier. </param>
/// <returns> The place by identifier. </returns>
public PlaceModel GetPlaceById(string id)
public T GetPlaceById(string id)
{
foreach (PlaceModel place in this.Places)
foreach (T place in this.Places)
{
if (place.PlaceId.Equals(id))
{
@@ -131,7 +132,7 @@ namespace CampusAppWP8.Model.GeoDb
{
foreach (string pid in pidList)
{
PlaceModel place = this.GetPlaceById(pid);
T place = this.GetPlaceById(pid);
if (!place.ContainsInformationNames(names))
{
return false;
@@ -150,7 +151,7 @@ namespace CampusAppWP8.Model.GeoDb
{
foreach (string pid in pidList)
{
PlaceModel place = this.GetPlaceById(pid);
T place = this.GetPlaceById(pid);
if (!place.ContainsServiceNames(names))
{
return false;
@@ -164,16 +165,16 @@ namespace CampusAppWP8.Model.GeoDb
/// <remarks> Stubbfel, 11.09.2013. </remarks>
/// <param name="pidList"> List of pids. </param>
/// <returns> filtered list of places. </returns>
public List<PlaceModel> FilterByPid(List<string> pidList)
public List<T> FilterByPid(List<string> pidList)
{
List<PlaceModel> fitlerList = new List<PlaceModel>();
List<T> fitlerList = new List<T>();
if (pidList == null || pidList.Count < 1)
{
return fitlerList;
}
foreach (PlaceModel place in this.Places)
foreach (T place in this.Places)
{
if (pidList.Contains(place.PlaceId))
{
@@ -195,7 +196,7 @@ namespace CampusAppWP8.Model.GeoDb
/// <param name="ignoreCases"> (Optional) the ignore cases. </param>
/// <param name="informationNames"> (Optional) name of the information. </param>
/// <returns> true if it match otherwise false. </returns>
private bool IsPlaceQueryMatched(PlaceModel place, string query, bool ignoreCases = true, List<string> informationNames = null)
private bool IsPlaceQueryMatched(T place, string query, bool ignoreCases = true, List<string> informationNames = null)
{
string queryString = query;
if (ignoreCases)

View File

@@ -129,6 +129,9 @@
<data name="PathNews_NewsIndexPage" xml:space="preserve">
<value>/Pages/News/NewsIndexPage.xaml</value>
</data>
<data name="PisInformationName_Layer" xml:space="preserve">
<value>Ebene</value>
</data>
<data name="UniCBTelPrefix" xml:space="preserve">
<value>035569</value>
</data>

View File

@@ -97,6 +97,15 @@ namespace CampusAppWPortalLib8.Resources {
}
}
/// <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 035569 ähnelt.
/// </summary>