本文整理汇总了C#中iCalDateTime.GreaterThanOrEqual方法的典型用法代码示例。如果您正苦于以下问题:C# iCalDateTime.GreaterThanOrEqual方法的具体用法?C# iCalDateTime.GreaterThanOrEqual怎么用?C# iCalDateTime.GreaterThanOrEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iCalDateTime
的用法示例。
在下文中一共展示了iCalDateTime.GreaterThanOrEqual方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ByMonth1
public void ByMonth1()
{
IICalendar iCal = iCalendar.LoadFromFile(@"Calendars\Recurrence\ByMonth1.ics")[0];
ProgramTest.TestCal(iCal);
IEvent evt = iCal.Events[0];
IList<Occurrence> occurrences = evt.GetOccurrences(
new iCalDateTime(1998, 1, 1, tzid),
new iCalDateTime(2000, 12, 31, tzid));
IDateTime dt = new iCalDateTime(1998, 1, 1, 9, 0, 0, tzid);
int i = 0;
while (dt.Year < 2001)
{
if (dt.GreaterThanOrEqual(evt.Start) &&
dt.Month == 1 &&
dt.LessThanOrEqual(new iCalDateTime(2000, 1, 31, 9, 0, 0, tzid)))
{
Assert.AreEqual(dt, occurrences[i].Period.StartTime, "Event should occur at " + dt);
i++;
}
dt = dt.AddDays(1);
}
}
示例2: DailyUntil1
public void DailyUntil1()
{
IICalendar iCal = iCalendar.LoadFromFile(@"Calendars\Recurrence\DailyUntil1.ics")[0];
ProgramTest.TestCal(iCal);
IEvent evt = iCal.Events[0];
IList<Occurrence> occurrences = evt.GetOccurrences(
new iCalDateTime(1997, 9, 1, tzid),
new iCalDateTime(1998, 1, 1, tzid));
IDateTime dt = new iCalDateTime(1997, 9, 2, 9, 0, 0, tzid);
int i = 0;
while (dt.Year < 1998)
{
if ((dt.GreaterThanOrEqual(evt.Start)) &&
(dt.LessThan(new iCalDateTime(1997, 12, 24, 0, 0, 0, tzid))))
{
Assert.AreEqual(dt, occurrences[i].Period.StartTime, "Event should occur at " + dt);
Assert.IsTrue(
(dt.LessThan(new iCalDateTime(1997, 10, 26, tzid)) && dt.TimeZoneName == "EDT") ||
(dt.GreaterThan(new iCalDateTime(1997, 10, 26, tzid)) && dt.TimeZoneName == "EST"),
"Event " + dt + " doesn't occur in the correct time zone (including Daylight & Standard time zones)");
i++;
}
dt = dt.AddDays(1);
}
}