76 lines
2.6 KiB
C#
76 lines
2.6 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> 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
|
|
}
|
|
}
|