//----------------------------------------------------------------------- // // The MIT License (MIT). Copyright (c) 2013 BTU/IIT. // // Stubbfel // 15.10.2013 // Implements the lecture activity class //----------------------------------------------------------------------- namespace CampusAppWPortalLib8.Model.Lecture { using System.Collections.ObjectModel; using System.Xml.Serialization; using CampusAppWPortalLib8.Resources; using CampusAppWPortalLib8.Utility; /// Model for a Activity. /// Stubbfel, 15.10.2013. public class LectureActivity { #region Members /// The activity icon name lecture. public const string ActivityTypeLecture = "Vorlesung"; /// The activity icon name seminar. public const string ActivityTypeSeminar = "Seminar"; /// The activity icon name practice. public const string ActivityTypePract = "Übung"; /// The activity icon name lab. public const string ActivityTypeLab = "Labor"; /// The activity icon name exam. public const string ActivityTypeExam = "Prüfung"; /// List of lecturer. private ObservableCollection lecturer; /// a formatted string for the names of the lecturers. private string lecturerString; /// a formatted string for the names of the courses. private string courseString; /// a formatted string for the topic of the lecture. private string topic; #endregion #region Constructor /// Initializes a new instance of the class. /// Stubbfel, 15.10.2013. public LectureActivity() { } #endregion #region Proberty /// Gets or sets the type of the activity. /// The type. [XmlElement("art")] public string Type { get; set; } /// Gets or sets the id of the activity. /// The identifier. [XmlAttribute("id")] public int Id { get; set; } /// Gets or sets semester of the activity. /// The semester. [XmlElement("semester")] public int Semester { get; set; } /// Gets or sets the contact hour. /// The sws. [XmlElement("sws")] public string SWS { get; set; } /// Gets or sets LectureModule. /// The modul. [XmlElement("modul")] public LectureModule Modul { get; set; } /// Gets or sets LectureTitle. /// The title. [XmlElement("titel")] public string Title { get; set; } /// Gets or sets the lecturers. /// The lecturer. [XmlElement("lehrperson")] public ObservableCollection Lecturer { get { return this.lecturer; } set { if (value != this.lecturer) { this.lecturer = value; } } } /// Gets or sets the formatted string of the lecturers. /// The lecturer string. public string LecturerString { get { return this.lecturerString; } set { if (value != this.lecturerString) { this.lecturerString = value; } } } /// Gets or sets formatted string of the courses. /// The course string. public string CourseString { get { return this.courseString; } set { if (value != this.courseString) { this.courseString = value; } } } /// Gets or sets the courses. /// The course. [XmlElement("studiengang")] public ObservableCollection Course { get; set; } /// Gets or sets the dates of the activity. /// The dates. [XmlElement("termin")] public ObservableCollection Dates { get; set; } /// Gets or sets the Department. /// The department. [XmlElement("zugeordnete_einrichtung")] public string Department { get; set; } /// Gets or sets the topic of the Lecture. /// The topic. [XmlElement("lehrinhalt")] public string Topic { get { return this.topic; } set { if (value != this.topic) { this.topic = value; } } } #endregion #region Methods #region public /// Method create a formatted string of the LecturerList. /// Stubbfel, 15.10.2013. public void CreateLectureString() { string result = string.Empty; foreach (LectureLecturer tmpLecturer in this.Lecturer) { result += DefaultStringManager.AddNewLine(tmpLecturer.ToString()); } this.LecturerString = DefaultStringManager.RemoveNewLine(result); } /// Method create a formatted string of the CourseList. /// Stubbfel, 15.10.2013. public void CreateCourseString() { string result = string.Empty; foreach (LectureCourse course in this.Course) { result += DefaultStringManager.AddNewLine(course.Title); } this.CourseString = DefaultStringManager.RemoveNewLine(result); } #endregion #endregion } }