コード例 #1
0
 /// <summary>
 /// Creates an instance of <c>CourseEvent</c>.
 /// </summary>
 /// <param name="date">Date of the course.</param>
 /// <param name="start">Starting time of the course.</param>
 /// <param name="end">Ending time of the course.</param>
 /// <param name="room">Room designation of the course.</param>
 /// <param name="building">Building designation of the course.</param>
 /// <param name="teacher">The name of the teacher.</param>
 /// <param name="cm">Reference to the subject.</param>
 /// <param name="lt">Reference to the type of lecture.</param>
 public CourseEvent(string date, string start, string end, string room, string building, string teacher, CourseMain cm, LectureType lt)
 {
     this.Start    = DateTime.Parse($"{date.Trim()} {start.Trim()}");
     this.End      = DateTime.Parse($"{date.Trim()} {end.Trim()}");
     this.Room     = room.Trim();
     this.Building = building.Trim();
     this.Course   = cm;
     this.Type     = lt;
     this.Teacher  = teacher;
     this.Hash     = Library.GetHashString($"{this.Start}{this.End}{this.Location}{this.Teacher}{this.Course.Hash}{this.Type.Hash}");
 }