本文整理汇总了C#中Schedule.GetEventsByTarget方法的典型用法代码示例。如果您正苦于以下问题:C# Schedule.GetEventsByTarget方法的具体用法?C# Schedule.GetEventsByTarget怎么用?C# Schedule.GetEventsByTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule.GetEventsByTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEvents
public static void GetEvents(App app, Schedule schedule, string postfix, DateTime start, DateTime end, ScheduleEventCollection eventTo, ScheduleEventCollection eventFrom)
{
DateTime marginStart = start.AddDays(-1.0);
DateTime marginEnd = end.AddDays(1.0);
ScheduleEventCollection eventList = schedule.GetEventsByTarget(marginStart, marginEnd, Schedule.TargetType.User, app.UserId);
Properties.Settings settings = Properties.Settings.Default;
foreach (ScheduleEvent scheduleEvent in eventList)
{
if (scheduleEvent.StartOnly)
{
if (scheduleEvent.Start.CompareTo(start) < 0) continue;
}
else if (scheduleEvent.AllDay || scheduleEvent.IsBanner)
{
if (scheduleEvent.End.CompareTo(start) < 0) continue;
}
else
{
if (scheduleEvent.Start.Equals(scheduleEvent.End))
{
if (scheduleEvent.End.CompareTo(start) < 0) continue;
}
else
{
if (scheduleEvent.End.CompareTo(start) <= 0) continue;
}
}
if (scheduleEvent.Start.CompareTo(end) >= 0) continue;
if (scheduleEvent.Detail.EndsWith(postfix) || scheduleEvent.Description.StartsWith(DescriptionHeaderName))
{
//if (scheduleEvent.MemberCount <= 1)
{
eventFrom.Add(scheduleEvent);
}
}
else if (!scheduleEvent.AllDay || (settings.AllDay && scheduleEvent.AllDay) || (settings.Banner && scheduleEvent.IsBanner) || (settings.Temporary && scheduleEvent.IsTemporary) || (settings.Private && scheduleEvent.IsPrivate) || (settings.Qualified && scheduleEvent.IsQualified))
{
eventTo.Add(scheduleEvent);
}
}
}