Files
win8phoneApp/CampusAppWP8/CampusAppWP8/Model/Campusmap/CampusMapModel.cs
2013-10-08 10:24:36 +02:00

72 lines
2.0 KiB
C#

//-----------------------------------------------------------------------
// <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;
}
public CampusMapModel()
{
}
#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
}
}