#if FRAMEWORK20
using System;
using DevComponents.Schedule.Model;
namespace DevComponents.DotNetBar.Schedule
{
    public class AppointmentMonthView : AppointmentHView
    {
        #region Constants
        private const int DaysInWeek = 7;
        #endregion
        #region Private variables
        private MonthWeek _MonthWeek;
        #endregion
        /// 
        /// Constructor
        /// 
        /// 
        /// 
        public AppointmentMonthView(BaseView baseView, Appointment appointment)
            : base(baseView, appointment)
        {
        }
        #region Public properties
        /// 
        /// Gets and sets View MonthWeek
        /// 
        public MonthWeek MonthWeek
        {
            get { return (_MonthWeek); }
            set
            {
                if (_MonthWeek != value)
                {
                    _MonthWeek = value;
                    SetViewEnds();
                }
            }
        }
        #endregion
        #region SetViewEnds
        /// 
        /// Sets the view display end types
        /// 
        protected override void SetViewEnds()
        {
            if (_MonthWeek != null)
            {
                DateTime start = _MonthWeek.FirstDayOfWeek;
                DateTime end = start.AddDays(DaysInWeek);
                ViewEnds = eViewEnds.Complete;
                // Check to see if we can only display
                // a partial representation for the view
                if (EndTime >= start && StartTime < end)
                {
                    if (StartTime < start)
                        ViewEnds |= eViewEnds.PartialLeft;
                    if (EndTime > end)
                        ViewEnds |= eViewEnds.PartialRight;
                }
            }
        }
        #endregion
    }
}
#endif