2011-10-13 17 views
13

Làm cách nào để thêm người tham dự bắt buộc/tùy chọn + người tổ chức vào sự kiện iCal?DDay iCal - thêm Người tham dự

Tôi đang sử dụng thư viện DDay tuyệt vời và rất muốn có thể cũng là add a CN, nhưng chưa tìm thấy bất kỳ ví dụ nào trong số documentation, ví dụ đã tải xuống hoặc ở nơi khác.

Cảm ơn!

Trả lời

9

Tôi đã nhận được giải pháp. Không phải là rất gọn gàng nhưng nó làm việc cho tôi.

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:[email protected]") 
{ 
    CommonName = "Naveen Jose", 
    Role = "REQ-PARTICIPANT" 
}; 
attendes.Add(attendee1); 
//optional attendee 
IAttendee attendee2 = new DDay.iCal.Attendee("MAILTO:[email protected]") 
{ 
    CommonName = "Noah Naveen", 
    Role = "OPT-PARTICIPANT" 
}; 
attendes.Add(attendee2); 
if (attendes != null && attendes.Count > 0) 
{ 
    evt.Attendees = attendes; 
} 
+0

Cảm ơn - mà làm việc cho tôi. – seekay

2

Bạn cũng có thể sử dụng RSVP = true để nhắc nhở cho một câu trả lời từ người tham dự

IAttendee attendee1 = new DDay.iCal.Attendee("MAILTO:[email protected]") 
{ 
    CommonName = "Naveen Jose", 
    Role = "REQ-PARTICIPANT", 
    RSVP = true 
}; 
Các vấn đề liên quan