Files
win8phoneApp/CampusAppWP8/CampusAppWPortalLib8/Model/GeoDb/CampusBuildingLayerModel.cs
2013-10-21 15:04:24 +02:00

75 lines
2.4 KiB
C#

//-----------------------------------------------------------------------
// <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> Class is model for buildings of a campus. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public class CampusBuildingLayerModel<V> where V : PlaceModel
{
#region Constructor
public CampusBuildingLayerModel()
{
}
/// <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<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
}
}