/// <summary> /// Draws all weeks of the specified month. /// </summary> private void DrawWeeks(MonthInfo month, ref float topOffset) { SizeF weekRowSize = CalendarData.GetDefaultWeekRowSize(MonthAreaSize); SizeF dayCellSize = CalendarData.GetDayCellSize(weekRowSize); // do the first pass to collect day info objects List <DayInfo> days = CollectDays(month, dayCellSize, ref topOffset); // sort the days according to its day kind days.Sort(new DayInfo.Comparer()); // render sorted days RenderDays(days); // render appointments on the top RenderAppointments(month, days, dayCellSize); }