246 lines
8.7 KiB
C#
246 lines
8.7 KiB
C#
//-----------------------------------------------------------------------
|
|
// <copyright file="MapPinModel.cs" company="BTU/IIT">
|
|
// The MIT License (MIT). Copyright (c) 2013 BTU/IIT.
|
|
// </copyright>
|
|
// <author>Stubbfel</author>
|
|
// <date>14.10.2013</date>
|
|
// <summary>Implements the map pin model class</summary>
|
|
//-----------------------------------------------------------------------
|
|
namespace CampusAppWPortalLib8.Model.Campusmap.Pin
|
|
{
|
|
using CampusAppWPortalLib8.Model.Utility;
|
|
using CampusAppWPortalLib8.Resources;
|
|
|
|
/// <summary> This Class manage the properties of a MapPin. </summary>
|
|
/// <remarks> Stubbfel, 14.10.2013. </remarks>
|
|
public abstract class MapPinModel
|
|
{
|
|
#region Member
|
|
|
|
/// <summary> String for info pins. </summary>
|
|
private static string infoPlacePinString = MapPinModel.PinTypeToString(PinType.InfoPlace);
|
|
|
|
/// <summary> String for info pins. </summary>
|
|
private static string infoLabPlacePinString = MapPinModel.PinTypeToString(PinType.InfoLabPlace);
|
|
|
|
/// <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 currentPositionPlacePinString = MapPinModel.PinTypeToString(PinType.CurrentPosition);
|
|
|
|
/// <summary> The information wc place pin string. </summary>
|
|
private static string infoWcPlacePinString = MapPinModel.PinTypeToString(PinType.InfoWcPlace);
|
|
|
|
/// <summary> The information access place pin string. </summary>
|
|
private static string infoAccesPlacePinString = MapPinModel.PinTypeToString(PinType.InfoAccesPlace);
|
|
|
|
/// <summary> The information red place pin string. </summary>
|
|
private static string infoRedPlacePinString = MapPinModel.PinTypeToString(PinType.InfoRedPlace);
|
|
|
|
/// <summary> Variable of the actual position of the pin. </summary>
|
|
private MapPoint position;
|
|
|
|
#endregion
|
|
|
|
#region Constructor
|
|
|
|
/// <summary> Initializes a new instance of the <see cref="MapPinModel" /> class. </summary>
|
|
/// <remarks> Stubbfel, 14.10.2013. </remarks>
|
|
public MapPinModel()
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region enums
|
|
|
|
/// <summary> Values that represent PinType. </summary>
|
|
/// <remarks> Stubbfel, 27.08.2013. </remarks>
|
|
public enum PinType
|
|
{
|
|
/// <summary>An enum constant representing the hidden option.</summary>
|
|
Hidden = 0,
|
|
|
|
/// <summary>An enum constant representing the search place option.</summary>
|
|
SearchPlace = 1,
|
|
|
|
/// <summary>An enum constant representing the current position option.</summary>
|
|
CurrentPosition = 2,
|
|
|
|
/// <summary>An enum constant representing the info place option.</summary>
|
|
InfoPlace = 3,
|
|
|
|
/// <summary> An enum constant representing the information lab place option. </summary>
|
|
InfoLabPlace = 4,
|
|
|
|
/// <summary> An enum constant representing the information wc place option. </summary>
|
|
InfoWcPlace = 5,
|
|
|
|
/// <summary> An enum constant representing the information red place option. </summary>
|
|
InfoRedPlace = 6,
|
|
|
|
/// <summary> An enum constant representing the information access place option. </summary>
|
|
InfoAccesPlace = 7
|
|
}
|
|
#endregion
|
|
|
|
#region Property
|
|
|
|
/// <summary> Gets the information red place pin string. </summary>
|
|
/// <value> The information red place pin string. </value>
|
|
public static string InfoRedPlacePinString
|
|
{
|
|
get { return MapPinModel.infoRedPlacePinString; }
|
|
}
|
|
|
|
/// <summary> Gets the information access place pin string. </summary>
|
|
/// <value> The information access place pin string. </value>
|
|
public static string InfoAccesPlacePinString
|
|
{
|
|
get { return MapPinModel.infoAccesPlacePinString; }
|
|
}
|
|
|
|
/// <summary> Gets the information wc place pin string. </summary>
|
|
/// <value> The information wc place pin string. </value>
|
|
public static string InfoWcPlacePinString
|
|
{
|
|
get { return MapPinModel.infoWcPlacePinString; }
|
|
}
|
|
|
|
/// <summary> Gets the string of current position pins. </summary>
|
|
/// <value> The current position place pin string. </value>
|
|
public static string CurrentPositionPlacePinString
|
|
{
|
|
get { return MapPinModel.currentPositionPlacePinString; }
|
|
}
|
|
|
|
/// <summary> Gets the string of search pins. </summary>
|
|
/// <value> The search place pin string. </value>
|
|
public static string SearchPlacePinString
|
|
{
|
|
get { return MapPinModel.searchPlacePinString; }
|
|
}
|
|
|
|
/// <summary> Gets the string of hidden pins. </summary>
|
|
/// <value> The hidden place pin string. </value>
|
|
public static string HiddenPlacePinString
|
|
{
|
|
get { return MapPinModel.hiddenPlacePinString; }
|
|
}
|
|
|
|
/// <summary> Gets the string of info pins. </summary>
|
|
/// <value> The information place pin string. </value>
|
|
public static string InfoPlacePinString
|
|
{
|
|
get { return MapPinModel.infoPlacePinString; }
|
|
}
|
|
|
|
/// <summary> Gets the information lab place pin string. </summary>
|
|
/// <value> The information lab place pin string. </value>
|
|
public static string InfoLabPlacePinString
|
|
{
|
|
get { return MapPinModel.infoLabPlacePinString; }
|
|
}
|
|
|
|
/// <summary> Gets or sets the ImageSource of the pin. </summary>
|
|
/// <value> The image source. </value>
|
|
public string ImageSource { get; set; }
|
|
|
|
/// <summary> Gets or sets the ImageWidth of the pin. </summary>
|
|
/// <value> The width of the image. </value>
|
|
public double ImageWidth { get; set; }
|
|
|
|
/// <summary> Gets or sets the ImageHeight of the pin. </summary>
|
|
/// <value> The height of the image. </value>
|
|
public double ImageHeight { get; set; }
|
|
|
|
/// <summary> Gets or sets the ZIndex of the pin. </summary>
|
|
/// <value> The z coordinate index. </value>
|
|
public int ZIndex { get; set; }
|
|
|
|
/// <summary> Gets or sets the pin image offset point. </summary>
|
|
/// <value> The pin image offset point. </value>
|
|
public MapPoint PinImageOffsetPoint { get; set; }
|
|
|
|
/// <summary> Gets or sets the tag of the pin. </summary>
|
|
/// <value> The tag. </value>
|
|
public object Tag { get; set; }
|
|
|
|
#region Property
|
|
|
|
/// <summary> Gets or sets position of the pin. </summary>
|
|
/// <value> The position. </value>
|
|
public MapPoint Position
|
|
{
|
|
get
|
|
{
|
|
return this.position;
|
|
}
|
|
|
|
set
|
|
{
|
|
// null assert
|
|
if (value == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (this.position == null)
|
|
{
|
|
this.position = value;
|
|
return;
|
|
}
|
|
|
|
MapPoint newPoint = value + this.PinImageOffsetPoint;
|
|
if (!newPoint.Equals(this.position))
|
|
{
|
|
this.position = newPoint;
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
#endregion
|
|
|
|
#region Method
|
|
|
|
/// <summary> Method convert PinType to a string. </summary>
|
|
/// <remarks> Stubbfel, 14.10.2013. </remarks>
|
|
/// <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.InfoLabPlace:
|
|
result = Constants.PinType_InfoLab;
|
|
break;
|
|
case PinType.SearchPlace:
|
|
result = Constants.PinType_Search;
|
|
break;
|
|
default:
|
|
result = string.Empty;
|
|
break;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|