13

如何将必需/可选的与会者 + 组织者添加到 iCal 活动?

我正在使用优秀的 DDay 库,并且希望能够添加 CN ,但在文档、下载的示例或其他地方没有找到任何示例。

谢谢!

4

2 回答 2

9

我有一个解决方案。不是很整洁,但它对我有用。

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;
}
于 2011-11-24T06:55:47.430 回答
2

您还可以使用 RSVP = true 提示与会者回复

IAttendee attendee1 = new DDay.iCal.Attendee("MAILTO:myid@gmail.com")
{
    CommonName = "Naveen Jose",
    Role = "REQ-PARTICIPANT",
    RSVP = true
};
于 2015-04-24T09:22:57.533 回答