#if FRAMEWORK20
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace DevComponents.Schedule.Model
{
///
/// Represents the calendar day.
///
public class Day
{
#region Constructor
///
/// Initializes a new instance of the Day class.
///
///
///
public Day(DateTime dayDate, CalendarModel calendar)
{
_DayDate = dayDate;
_Calendar = calendar;
}
#endregion
#region Internal Implementation
private AppointmentSubsetCollection _Appointments;
///
/// Gets appointments that start on this day.
///
public AppointmentSubsetCollection Appointments
{
get
{
if (_Appointments == null)
_Appointments = new AppointmentSubsetCollection(_Calendar, _DayDate, DateTimeHelper.EndOfDay(_DayDate));
return _Appointments;
}
}
///
/// Invalidate the day appointments
///
internal void InvalidateAppointments()
{
if (_Appointments != null)
_Appointments.InvalidateCollection();
}
private DateTime _DayDate = DateTime.MinValue;
///
/// Gets the date this day represents.
///
[Browsable(false)]
public DateTime DayDate
{
get { return _DayDate; }
internal set { _DayDate = value; }
}
private CalendarModel _Calendar;
///
/// Gets the Calendar this day is part of.
///
[Browsable(false)]
public CalendarModel Calendar
{
get { return _Calendar; }
internal set { _Calendar = value; }
}
#endregion
}
}
#endif