如何遍历日历日程控件两个时间点之间的所有任务

作者:控件中国网   出处:控件中国网   2015-07-21 10:43:21   阅读:15

DotNetBar for Windows Forms提供了日历日程控件,在使用日历日程控件时经常需要知道两个时间段之间到底有哪些任务,Schedule为开发人员提供了方法可枚举出两个时间点之间的所有任务安排,具体代码如下:

DateTime start = new DateTime(2014, 05, 07);
DateTime end = start.AddDays(10);
DateTime d = start;
while (d <= end)
{
    DevComponents.Schedule.Model.Day day = calendarView1.CalendarModel.GetDay(d);
    foreach (Appointment item in day.Appointments)
    {
        Console.WriteLine("Appointment: {0}-{1} {2}", item.StartTime, item.EndTime, item.Subject);
    }
    d = d.AddDays(1);
}

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat