/// <summary>
        /// Handles the BeforeAlternateSelectedDateRangeChange event of the ultraCalendarInfo1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="BeforeSelectedDateRangeChangeEventArgs"/> instance containing the event data.</param>
        private void ultraCalendarInfo1_BeforeAlternateSelectedDateRangeChange(object sender, BeforeSelectedDateRangeChangeEventArgs e)
        {
            if (this.timeSlotSelectionRecursionFlag)
            {
                e.Cancel = true;
                return;
            }

            if (this.dateSelectionRecursionFlag)
            {
                return;
            }

            if (this.ultraCalendarInfo1.AlternateSelectedDateRanges.SelectedDaysCount > 0 &&
                e.NewSelectedDateRanges.SelectedDaysCount > 0)
            {
                Infragistics.Win.UltraWinSchedule.Day currentFirstDay = this.ultraCalendarInfo1.AlternateSelectedDateRanges[0].FirstDay;
                Infragistics.Win.UltraWinSchedule.Day newFirstDay     = e.NewSelectedDateRanges[0].FirstDay;

                int compareValue = DateTime.Compare(currentFirstDay.Date, newFirstDay.Date);
                if (compareValue > 0)
                {
                    this.SelectWorkWeek(currentFirstDay.Week.WeekNumber - 1, currentFirstDay.Week.Year.YearNumber);
                    e.Cancel = true;
                }
                else if (compareValue < 0)
                {
                    this.SelectWorkWeek(currentFirstDay.Week.WeekNumber + 1, currentFirstDay.Week.Year.YearNumber);
                    e.Cancel = true;
                }
            }
        }
 public void ViewDay(
     object sender,
     Day e)
 {
     var aDayView = new CtrlCalendarScheduleDay(e);
     //{ultraDayView1 = {CalendarInfo = ultraCalendarInfo1}};
     Form aFrm = ((Control) sender).FindForm();
     aDayView.Parent = aFrm;
     aDayView.Show();
     aDayView.BringToFront();
 }
 public CtrlCalendarScheduleDay(Day day)
 {
     InitializeComponent();
     Aday = day;
 }