希望有人可以提供帮助。将 DDay.iCal 版本 1.0.1.490 与 .net 版本 2 一起使用,我在调用 SerilizeToString 方法后得到重复的事件事件。
示例代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DDay.iCal;
using DDay.iCal.Serialization.iCalendar;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
iCalendar iCal = new iCalendar();
Event evt = iCal.Create<Event>();
Uri eventLink = new Uri("http://middlebury.edu";);
evt.IsAllDay = false;
evt.Start = new iCalDateTime(DateTime.Parse("2011-08-11"));
evt.Duration = new TimeSpan(2, 0, 0);
evt.Location = "Test";
evt.Summary = "Breakfast";
evt.Url = eventLink;
evt.Description = "Sausage Links" + "\n" + "Pancakes" + "\n";
iCal.Events.Add(evt);
iCalendarSerializer serializer = new iCalendarSerializer(iCal);
string result = serializer.SerializeToString(iCal);
}
}
}