本文整理汇总了C#中iCalendar.AddProperty方法的典型用法代码示例。如果您正苦于以下问题:C# iCalendar.AddProperty方法的具体用法?C# iCalendar.AddProperty怎么用?C# iCalendar.AddProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iCalendar
的用法示例。
在下文中一共展示了iCalendar.AddProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XProperty4
public void XProperty4()
{
iCalendar iCal = new iCalendar();
iCal.AddProperty("X-WR-CALNAME", "DDay Test");
iCal.AddProperty("X-WR-CALDESC", "Events for a DDay Test");
iCal.AddProperty("X-PUBLISHED-TTL", "PT30M");
iCal.ProductID = "-//DDAYTEST//NONSGML www.test.com//EN";
// Create an event in the iCalendar
Event evt = iCal.Create<Event>();
// Populate the properties
evt.Start = new iCalDateTime(2009, 6, 28, 8, 0, 0);
evt.Duration = TimeSpan.FromHours(1);
evt.Url = new Uri("http://www.ftb.pl/news/59941_0_1/tunnel-electrocity-2008-timetable.htm");
evt.Summary = "This is a title";
evt.Description = "This is a description";
iCalendarSerializer serializer = new iCalendarSerializer();
string output = serializer.SerializeToString(iCal);
serializer.Serialize(iCal, @"Calendars/Serialization/XProperty4.ics");
Assert.IsFalse(Regex.IsMatch(output, @"\r\n[\r\n]"));
SerializeTest("XProperty4.ics", typeof(iCalendarSerializer));
}