Example #1
0
 private void SetCurrentDate(DateTime cDate, DayModel dayCellAux)
 {
     if (cDate.Date == _currentDate.Date)
     {
         dayCellAux.Selected = true;
     }
 }
Example #2
0
        private void MakeCurrentCalendar()
        {
            currentCalendar = new DayModel[MAX_WEEKS, MAX_DAYS];

            int lastDay = DateTime.DaysInMonth(_currentDate.Year, _currentDate.Month);

            DateTime cDate = new DateTime(_currentDate.Year, _currentDate.Month, 1);

            DayModel dayCellAux = null;

            for (int i = 1, line = 0; i <= lastDay; i++)
            {
                dayCellAux = new DayModel(cDate);

                currentCalendar[line, Convert.ToInt32(cDate.DayOfWeek)] = dayCellAux;

                if (cDate.DayOfWeek == DayOfWeek.Saturday)
                {
                    line++;
                }

                cDate = cDate.AddDays(1);
                //SetCurrentDate(cDate, dayCellAux);
            }
        }