-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cours.cs
34 lines (28 loc) · 1023 Bytes
/
Cours.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Ical.Net.CalendarComponents;
using System;
namespace ICSFileReader
{
public class Cours
{
public string Name { get; set; }
public string Description { get; set; }
public string Location { get; set; }
public DateTime DateStart { get; set; }
public DateTime DateEnd { get; set; }
// Constructor that convert CalendarEvent to Cours
public Cours(CalendarEvent evt)
{
Name = evt.Summary.Trim();
Description = evt.Description.Trim();
Location = evt.Location.Trim();
DateStart = evt.DtStart.AsSystemLocal;
DateEnd = evt.DtEnd.AsSystemLocal;
}
public override string ToString() =>
$"Cours: {Name}{Environment.NewLine}" +
$"Description: {Description}{Environment.NewLine}" +
$"Location: {Location}{Environment.NewLine}" +
$"Start Date: {DateStart}{Environment.NewLine}" +
$"End Date: {DateEnd}";
}
}