private void btnAddHoliday_Click(object sender, EventArgs e) { DayIntervalCollection days = new DayIntervalCollection(); days.Add(schedulerControl1.SelectedInterval); schedulerControl1.BeginUpdate(); try { for (int i = 0; i < days.Count; i++) { AddHoliday(days[i].Start); } } finally { schedulerControl1.EndUpdate(); } }
static AppointmentBaseCollection DivideApointments(Appointment sourceApt) { DayIntervalCollection daysCollection = new DayIntervalCollection(); daysCollection.Add(new TimeInterval(sourceApt.Start, sourceApt.End)); AppointmentBaseCollection dividedApts = new AppointmentBaseCollection(); foreach (TimeInterval day in daysCollection) { Appointment dailyApt = sourceApt.Copy(); dailyApt.Start = day.Start.Date; dailyApt.End = day.End.Date; dailyApt.AllDay = true; dividedApts.Add(dailyApt); } AdjustStart(dividedApts, sourceApt); AdjustEnd(dividedApts, sourceApt); return(dividedApts); }
private void btnAddHoliday_Click(object sender, EventArgs e) { DayIntervalCollection days = new DayIntervalCollection(); days.Add(schedulerControl1.SelectedInterval); schedulerControl1.BeginUpdate(); try { for (int i = 0; i < days.Count; i++) AddHoliday(days[i].Start); } finally { schedulerControl1.EndUpdate(); } }