using System; using System.Collections.Generic; using System.Text; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; using System.Diagnostics; using System.Data; using System.Xml.Serialization; namespace HeuristicLab.Calendar { public class Appointment : iAppointment { #region " Private Fields " private int layer; private string group; private DateTime startDate; private DateTime endDate; private bool locked; private Color color = Color.White; private Color textColor = Color.Black; private int appointmentId = 0; private Color borderColor = Color.Blue; private bool drawBorder = false; private string subject = string.Empty; private bool allDayEvent = false; private bool reccuringEvent = false; private Guid reccuringID = Guid.Empty; internal int conflictCount; #endregion public Appointment() { color = Color.White; borderColor = Color.Blue; Subject = "New Appointment"; } #region " Public Properties " [XmlIgnore] public int Layer { get { return layer; } set { layer = value; } } [XmlIgnore] public string Group { get { return group; } set { group = value; } } [XmlAttribute("Locked")] [System.ComponentModel.DefaultValue(false)] public bool Locked { get { return locked; } set { locked = value; OnLockedChanged(); } } [XmlIgnore] public Color Color { get { return color; } set { color = value; OnColorChanged(); } } [XmlIgnore] public Color TextColor { get { return textColor; } set { textColor = value; OnTextColorChanged(); } } [XmlIgnore] public Color BorderColor { get { return borderColor; } set { borderColor = value; OnBorderColorChanged(); } } [XmlIgnore] public bool DrawBorder { get { return drawBorder; } set { drawBorder = value; } } [XmlAttribute("AllDayEvent")] public bool AllDayEvent { get { return allDayEvent; } set { allDayEvent = value; OnAllDayEventChanged(); } } [XmlAttribute("Recurring")] public bool Recurring { get { return reccuringEvent; } set { reccuringEvent = value; } } [XmlAttribute("RecurringId")] public Guid RecurringId { get { return reccuringID; } set { reccuringID = value; } } #endregion #region " Events " protected virtual void OnStartDateChanged() { } protected virtual void OnEndDateChanged() { } protected virtual void OnLockedChanged() { } protected virtual void OnColorChanged() { } protected virtual void OnTextColorChanged() { } protected virtual void OnBorderColorChanged() { } protected virtual void OnTitleChanged() { } protected virtual void OnAllDayEventChanged() { } #endregion #region iAppointment Members [XmlAttribute("StartDate")] public DateTime StartDate { get { return startDate; } set { startDate = value; OnStartDateChanged(); } } [XmlAttribute("EndDate")] public DateTime EndDate { get { return endDate; } set { endDate = value; OnEndDateChanged(); } } [XmlIgnore] public int AppointmentId { get { return appointmentId; } set { appointmentId = value; } } [XmlElement("Subject")] public string Subject { get { return subject; } set { subject = value; } } [XmlIgnore] public string Location { get; set; } [XmlIgnore] public string Note { get; set; } #endregion } }