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

90 lines
2.4 KiB
C#

//-----------------------------------------------------------------------
// <copyright file="LectureModule.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 lecture module class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Lecture
{
using System;
using System.Xml.Serialization;
using CampusAppWPortalLib8.Resources;
/// <summary> Model for the module of an lecture. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public class LectureModule
{
#region Members
/// <summary> Number of the module (like an id) </summary>
private int number;
/// <summary> Url to the website of the module. </summary>
private Uri url;
#endregion
#region Constructor
/// <summary> Initializes a new instance of the <see cref="LectureModule" /> class. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public LectureModule()
{
}
#endregion
#region Property
/// <summary> Gets or sets the title of the module. </summary>
/// <value> The title. </value>
[XmlElement("titel")]
public string Title { get; set; }
/// <summary> Gets or sets the number of the module and create the URL. </summary>
/// <value> The total number of ber. </value>
[XmlElement("nummer")]
public int Number
{
get
{
return this.number;
}
set
{
if (value != this.number)
{
this.number = value;
this.CreateUrl();
}
}
}
/// <summary> Gets the URL of the module. </summary>
/// <value> The URL. </value>
public Uri Url
{
get
{
return this.url;
}
}
#endregion
#region Methods
/// <summary> Method create the url of the module. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
private void CreateUrl()
{
this.url = new Uri(Constants.UrlLecture_ModulBaseAddr + this.number.ToString());
}
#endregion
}
}