如何将必需/可选的与会者 + 组织者添加到 iCal 活动?
我正在使用优秀的 DDay 库,并且希望能够添加 CN ,但在文档、下载的示例或其他地方没有找到任何示例。
谢谢!
我有一个解决方案。不是很整洁,但它对我有用。
iCalendar calendar = new iCalendar();
calendar.Method = "PUBLISH";
Event evt = calendar.Create<Event>();
var attendes = new List<IAttendee>();
//required attendee
IAttendee attendee1 = new DDay.iCal.Attendee("MAILTO:myid@gmail.com")
{
CommonName = "Naveen Jose",
Role = "REQ-PARTICIPANT"
};
attendes.Add(attendee1);
//optional attendee
IAttendee attendee2 = new DDay.iCal.Attendee("MAILTO:someid@codovations.com")
{
CommonName = "Noah Naveen",
Role = "OPT-PARTICIPANT"
};
attendes.Add(attendee2);
if (attendes != null && attendes.Count > 0)
{
evt.Attendees = attendes;
}
您还可以使用 RSVP = true 提示与会者回复
IAttendee attendee1 = new DDay.iCal.Attendee("MAILTO:myid@gmail.com")
{
CommonName = "Naveen Jose",
Role = "REQ-PARTICIPANT",
RSVP = true
};