本文整理汇总了C#中iCalendar类的典型用法代码示例。如果您正苦于以下问题:C# iCalendar类的具体用法?C# iCalendar怎么用?C# iCalendar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
iCalendar类属于命名空间,在下文中一共展示了iCalendar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
static public Todo Create(iCalendar iCal)
{
Todo t = new Todo(iCal);
t.UID = UniqueComponent.NewUID();
return t;
}
示例2: Create
static public Journal Create(iCalendar iCal)
{
Journal j = (Journal)iCal.Create(iCal, "VJOURNAL");
j.UID = UniqueComponent.NewUID();
return j;
}
示例3: Create
static public Todo Create(iCalendar iCal)
{
Todo t = (Todo)iCal.Create(iCal, "VTODO");
t.UID = UniqueComponent.NewUID();
return t;
}
示例4: Create
static public Event Create(iCalendar iCal)
{
Event evt = new Event(iCal);
evt.UID = UniqueComponent.NewUID();
return evt;
}
示例5: Create
static public Journal Create(iCalendar iCal)
{
Journal j = new Journal(iCal);
j.UID = UniqueComponent.NewUID();
return j;
}
示例6: Create
static public Todo Create(iCalendar iCal)
{
Todo t = (Todo)iCal.Create(iCal, "VTODO");
t.UID = UniqueComponent.NewUID();
t.Created = DateTime.Now;
t.DTStamp = DateTime.Now;
return t;
}
示例7: Create
static public Journal Create(iCalendar iCal)
{
Journal j = iCal.Create<Journal>();
j.UID = UniqueComponent.NewUID();
j.Created = DateTime.Now;
j.DTStamp = DateTime.Now;
return j;
}
示例8: UniqueComponent1
public void UniqueComponent1()
{
iCalendar iCal = new iCalendar();
Event evt = iCal.Create<Event>();
Assert.IsNotNull(evt.UID);
Assert.IsNotNull(evt.Created);
Assert.IsNotNull(evt.DTStamp);
}
示例9: UniqueComponent1
public void UniqueComponent1()
{
iCalendar iCal = new iCalendar();
Event evt = iCal.Create<Event>();
Assert.IsNotNull(evt.UID);
Assert.IsNull(evt.Created); // We don't want this to be set automatically
Assert.IsNotNull(evt.DTStamp);
}
示例10: Add1
public void Add1()
{
IICalendar iCal = new iCalendar();
Event evt = new Event();
evt.Summary = "Testing";
evt.Start = new iCalDateTime(2010, 3, 25);
evt.End = new iCalDateTime(2010, 3, 26);
iCal.Events.Add(evt);
Assert.AreEqual(1, iCal.Children.Count);
Assert.AreSame(evt, iCal.Children[0]);
}
示例11: Category
[Test, Category("DDay")] //Category(("FreeBusy")]
public void GetFreeBusyStatus1()
{
IICalendar iCal = new iCalendar();
IEvent evt = iCal.Create<DDayEvent>();
evt.Summary = "Test event";
evt.Start = new iCalDateTime(2010, 10, 1, 8, 0, 0);
evt.End = new iCalDateTime(2010, 10, 1, 9, 0, 0);
IFreeBusy freeBusy = iCal.GetFreeBusy(new iCalDateTime(2010, 10, 1, 0, 0, 0), new iCalDateTime(2010, 10, 7, 11, 59, 59));
Assert.AreEqual(FreeBusyStatus.Free, freeBusy.GetFreeBusyStatus(new iCalDateTime(2010, 10, 1, 7, 59, 59)));
Assert.AreEqual(FreeBusyStatus.Busy, freeBusy.GetFreeBusyStatus(new iCalDateTime(2010, 10, 1, 8, 0, 0)));
Assert.AreEqual(FreeBusyStatus.Busy, freeBusy.GetFreeBusyStatus(new iCalDateTime(2010, 10, 1, 8, 59, 59)));
Assert.AreEqual(FreeBusyStatus.Free, freeBusy.GetFreeBusyStatus(new iCalDateTime(2010, 10, 1, 9, 0, 0)));
}
示例12: CompareCalendars
static public void CompareCalendars(iCalendar iCal1, iCalendar iCal2)
{
Assert.IsTrue(object.Equals(iCal1.Method, iCal2.Method), "Methods do not match");
Assert.IsTrue(object.Equals(iCal1.ProductID, iCal2.ProductID), "ProductIDs do not match");
Assert.IsTrue(object.Equals(iCal1.Scale, iCal2.Scale), "Scales do not match");
Assert.IsTrue(object.Equals(iCal1.Version, iCal2.Version), "Versions do not match");
for (int i = 0; i < iCal1.Events.Count; i++)
CompareComponents(iCal1.Events[i], iCal2.Events[i]);
for (int i = 0; i < iCal1.FreeBusy.Count; i++)
CompareComponents(iCal1.FreeBusy[i], iCal2.FreeBusy[i]);
for (int i = 0; i < iCal1.Journals.Count; i++)
CompareComponents(iCal1.Journals[i], iCal2.Journals[i]);
for (int i = 0; i < iCal1.Todos.Count; i++)
CompareComponents(iCal1.Todos[i], iCal2.Todos[i]);
}
示例13: TestCorrectInput
public void TestCorrectInput()
{
vCalendar vcalendar = new vCalendar(@"BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
X-WR-CALDESC:CheckMyTrip Calendar
X-WR-CALNAME:2THQ73
PRODID:-//Amadeus/trip//NONSGML v1.0//EN
BEGIN:VEVENT
DTSTAMP:20150408T101400Z
UID:2THQ73FlightVIE_201504172000_201504172050
DTSTART:20150417T180000Z
DTEND:20150417T185000Z
SUMMARY:2THQ73 / Hennies - Flight: Vienna - Prague (Austrian Airlines OS 711)
LOCATION:Vienna International (Vienna\, Austria)
TRANSP:TRANSPARENT
DESCRIPTION:Trip status: Confirmed\n \n FLIGHT INFORMATION: \n \n Austrian Airlines OS 711: \n \n \n From: Vienna International (Vienna\, Austria) at Fri\, Apr 17\, 2015 20:00 (local time) \n To: Ruzyne (Prague\, Czech Republic) - Terminal2 at Fri\, Apr 17\, 2015 20:50 (local time) \n Cabin: Economy\n Duration: 00:50\n Stop(s): 0\n Aircraft: De Havilland DHC-8 400 Series\n Airline Recloc: 2THQ73\n \n http://www.checkmytrip.com/CMTServlet?R=2THQ73&L=US&N=Hennies\n
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150408T101400Z
UID:2THQ73FlightPRG_201504191840_201504191935
DTSTART:20150419T164000
DTEND:20150419T173500
SUMMARY:2THQ73 / Hennies - Flight 1 : Prague - Vienna (Austrian Airlines OS 710)
LOCATION:Ruzyne (Prague\, Czech Republic)
TRANSP:TRANSPARENT
DESCRIPTION:Trip status: Confirmed\n \n FLIGHT INFORMATION: \n \n Austrian Airlines OS 710: \n \n \n From: Ruzyne (Prague\, Czech Republic) - Terminal2 at Sun\, Apr 19\, 2015 18:40 (local time) \n To: Vienna International (Vienna\, Austria) at Sun\, Apr 19\, 2015 19:35 (local time) \n Cabin: Economy\n Duration: 00:55\n Stop(s): 0\n Aircraft: Fokker 70\n \n http://www.checkmytrip.com/CMTServlet?R=2THQ73&L=US&N=Hennies\n
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20150408T101400Z
UID:2THQ73FlightVIE_201504192035_201504192130
DTSTART:20150419T183500Z
DTEND:20150419T193000Z
SUMMARY:2THQ73 / Hennies - Flight 2 : Vienna - Innsbruck (Austrian Airlines OS 913)
LOCATION:Vienna International (Vienna\, Austria)
TRANSP:TRANSPARENT
DESCRIPTION:Trip status: Confirmed\n \n FLIGHT INFORMATION: \n \n Austrian Airlines OS 913: \n \n \n From: Vienna International (Vienna\, Austria) at Sun\, Apr 19\, 2015 20:35 (local time) \n To: Innsbruck Airport (Innsbruck\, Austria) at Sun\, Apr 19\, 2015 21:30 (local time) \n Cabin: Economy\n Duration: 00:55\n Stop(s): 0\n Aircraft: Fokker 100\n \n http://www.checkmytrip.com/CMTServlet?R=2THQ73&L=US&N=Hennies\n
END:VEVENT
END:VCALENDAR");
iCalendar ical = new iCalendar(vcalendar);
var a = ical[0].StartTime.ToLocalTime();
}
示例14: Create
static public IValidator Create(Type validatorType, iCalendar iCalendar, string iCalendarText)
{
IValidator validator = null;
if (validatorType != null)
{
ConstructorInfo ci = null;
if (iCalendar != null)
ci = validatorType.GetConstructor(new Type[] { typeof(iCalendar) });
if (ci != null)
validator = ci.Invoke(new object[] { iCalendar }) as IValidator;
else
{
if (iCalendarText != null)
ci = validatorType.GetConstructor(new Type[] { typeof(string) });
if (ci != null)
validator = ci.Invoke(new object[] { iCalendarText }) as IValidator;
}
}
return validator;
}
示例15: EVALUATE1
public void EVALUATE1()
{
iCalendar iCal = new iCalendar();
Event evt = iCal.Create<Event>();
evt.Summary = "Event summary";
// Start at midnight, UTC time
evt.Start = DateTime.SpecifyKind(DateTime.Today, DateTimeKind.Utc);
evt.AddRecurrence(new Recur("FREQ=MINUTELY;INTERVAL=10;COUNT=5"));
List<Occurrence> occurrences = evt.GetOccurrences(DateTime.Today.AddDays(1), DateTime.Today.AddDays(2));
foreach (Occurrence o in occurrences)
Assert.IsTrue(o.Period.StartTime.HasTime, "All recurrences of this event should have a time set.");
}