嗨,我正在从 DDay.ical 迁移到 Ical.Net nuget pacakages,但我陷入了以下代码,它在 DDay.Ical 日历中添加了时区,请帮忙
以前的代码:
List<DOAppointment> lst = objResponse.Appointments;
string timeZoneName = objResponse.UserTimezone;
iCalendar calendar = new DDay.iCal.iCalendar();
var timeZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneName);
calendar.AddTimeZone(iCalTimeZone.FromSystemTimeZone(timeZone));
迁移到 Ical.Net:
List<DOAppointment> lst = objResponse.Appointments;
string timeZoneName = objResponse.UserTimezone;
Ical.Net.Calendar calendar = new Ical.Net.Calendar();
var timeZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneName);
ITimeZone tzID = timeZone;
calendar.AddTimeZone(tzID);
在这里,我知道 calendar.AddTimezone 将采用 ITimezone 但如何通过它我没有得到帮助。