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

81 lines
2.5 KiB
C#

//-----------------------------------------------------------------------
// <copyright file="LectureLecturer.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 lecturer class</summary>
//-----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Lecture
{
using System.Xml.Serialization;
/// <summary> Model for a lecturer. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public class LectureLecturer
{
#region Constructor
/// <summary> Initializes a new instance of the <see cref="LectureLecturer" /> class. </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
public LectureLecturer()
{
}
#endregion
#region Property
/// <summary> Gets or sets the FirstName of a lecturer. </summary>
/// <value> The name of the first. </value>
[XmlElement("vorname")]
public string FirstName { get; set; }
/// <summary> Gets or sets the LastName of a lecturer. </summary>
/// <value> The name of the last. </value>
[XmlElement("name")]
public string LastName { get; set; }
/// <summary> Gets or sets the title of a lecturer. </summary>
/// <value> The title. </value>
[XmlElement("titel")]
public string Title { get; set; }
/// <summary> Gets or sets the Responsibility of a lecturer. </summary>
/// <value> The responsibility. </value>
[XmlAttribute("zustaendigkeit")]
public string Responsibility { get; set; }
#endregion
#region Method
/// <summary>
/// Method overrides the base ToString() and create an formatted string of the lecturer.
/// </summary>
/// <remarks> Stubbfel, 15.10.2013. </remarks>
/// <returns> returns a string like: [Title] FirstName LastName [(Responsibility)]. </returns>
public override string ToString()
{
string result = string.Empty;
if (!this.Title.Equals(string.Empty))
{
result += this.Title + " ";
}
result += this.FirstName + " ";
result += this.LastName + " ";
if (!this.Responsibility.Equals(string.Empty))
{
result += "(" + this.Responsibility + ") ";
}
return result;
}
#endregion
}
}