Files
win8phoneApp/CampusAppWP8/CampusAppWPortalLib8/Model/Exams/ExamListModel.cs
2013-10-02 13:27:45 +02:00

54 lines
1.6 KiB
C#

//-----------------------------------------------------------------------
// <copyright file="ExamlistModel.cs" company="BTU/IIT">
// Company copyright tag.
// </copyright>
// <author>stubbfel</author>
// <sience>02.09.2013</sience>
//----------------------------------------------------------------------
namespace CampusAppWPortalLib8.Model.Exams
{
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Xml.Serialization;
using CampusAppWPortalLib8.Model.Utility;
/// <summary>Exam list model.</summary>
/// <remarks>Stubbfel, 02.09.2013.</remarks>
[XmlRoot("links")]
public class ExamListModel<T> where T : ExamModel
{
#region Property
/// <summary>Gets or sets the exams.</summary>
/// <value>The exams.</value>
[XmlElement("link")]
public ObservableCollection<T> Exams { get; set; }
#endregion
#region Property
/// <summary>Creates course list.</summary>
/// <remarks>Stubbfel, 10.09.2013.</remarks>
/// <returns>The new course list.</returns>
public List<CourseModel> CreateCourseList()
{
List<CourseModel> result = new List<CourseModel>();
foreach (T exam in this.Exams)
{
CourseModel tmpModel = new CourseModel(exam.CourseNumber, exam.CourseText);
if (!result.Contains(tmpModel))
{
result.Add(tmpModel);
}
}
return result;
}
#endregion
}
}