Files
win8phoneApp/CampusAppWP8/CampusAppWPortalLib8/Model/Link/LinkModel.cs
2013-10-15 13:10:29 +02:00

162 lines
4.1 KiB
C#

//-----------------------------------------------------------------------
// <copyright file="LinkModel.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 link model class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Link
{
using System.Globalization;
using System.Xml.Serialization;
/// <summary> Model for menu. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public class LinkModel
{
#region Member
/// <summary> German version of the link title. </summary>
private string titleDE;
/// <summary> English version of the link title. </summary>
private string titleEN;
/// <summary> German version of the link. </summary>
private string linkDE;
/// <summary> English version of the link. </summary>
private string linkEN;
#endregion
#region Constructor
/// <summary> Initializes a new instance of the <see cref="LinkModel" /> class. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public LinkModel()
{
}
#endregion
#region Property
/// <summary> Gets or sets the german title of the link. </summary>
/// <value> The title de. </value>
[XmlAttribute("title_de")]
public string Title_DE
{
get
{
return this.titleDE;
}
set
{
if (value != this.titleDE)
{
this.titleDE = value;
}
}
}
/// <summary> Gets or sets the english title of the link. </summary>
/// <value> The title en. </value>
[XmlAttribute("title_en")]
public string Title_EN
{
get
{
return this.titleEN;
}
set
{
this.titleEN = value;
}
}
/// <summary> Gets or sets the german link. </summary>
/// <value> The link de. </value>
[XmlAttribute("link_de")]
public string Link_DE
{
get
{
return this.linkDE;
}
set
{
if (value != this.linkDE)
{
this.linkDE = value;
}
}
}
/// <summary> Gets or sets the english link. </summary>
/// <value> The link en. </value>
[XmlAttribute("link_en")]
public string Link_EN
{
get
{
return this.linkEN;
}
set
{
if (value != this.linkEN)
{
this.linkEN = value;
}
}
}
/// <summary>
/// Gets the localized title. If the phone is set to german language, the german title will
/// be returned otherwise the english title.
/// </summary>
/// <value> The title. </value>
public string Title
{
get
{
if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
{
return this.titleDE;
}
else
{
return this.titleEN;
}
}
}
/// <summary>
/// Gets the localized link. if the phone is set to german language, the german comment will
/// be returned otherwise the english link.
/// </summary>
/// <value> The link. </value>
public string Link
{
get
{
if (CultureInfo.CurrentUICulture.Name.StartsWith("de"))
{
return this.Link_DE;
}
else
{
return this.Link_EN;
}
}
}
#endregion
}
}