开发者

DDay iCal - adding an Attendee

开发者 https://www.devze.com 2023-04-12 11:06 出处:网络
How does one add required/optional attendees + organ开发者_如何学Pythonizer(s) to an iCal event?

How does one add required/optional attendees + organ开发者_如何学Pythonizer(s) to an iCal event?

I'm using the excellent DDay library, and would love to be able to also add a CN, but haven't found any examples in the documentation, the downloaded examples or elsewhere.

Thanks!


I got a solution. Not very neat but its working for me.

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;
}


You could also use RSVP = true to prompt for a reply from the attendee

IAttendee attendee1 = new DDay.iCal.Attendee("MAILTO:myid@gmail.com")
{
    CommonName = "Naveen Jose",
    Role = "REQ-PARTICIPANT",
    RSVP = true
};
0

精彩评论

暂无评论...
验证码 换一张
取 消