1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Text;
|
---|
4 | using System.Drawing;
|
---|
5 | using System.Drawing.Drawing2D;
|
---|
6 | using System.Windows.Forms;
|
---|
7 | using System.Diagnostics;
|
---|
8 | using System.Data;
|
---|
9 | using System.Xml.Serialization;
|
---|
10 |
|
---|
11 | namespace HeuristicLab.Calendar
|
---|
12 | {
|
---|
13 | public class Appointment : iAppointment
|
---|
14 | {
|
---|
15 |
|
---|
16 | #region " Private Fields "
|
---|
17 | private int layer;
|
---|
18 | private string group;
|
---|
19 | private DateTime startDate;
|
---|
20 | private DateTime endDate;
|
---|
21 | private bool locked;
|
---|
22 | private Color color = Color.White;
|
---|
23 | private Color textColor = Color.Black;
|
---|
24 | private int appointmentId = 0;
|
---|
25 | private Color borderColor = Color.Blue;
|
---|
26 | private bool drawBorder = false;
|
---|
27 | private string subject = string.Empty;
|
---|
28 | private bool allDayEvent = false;
|
---|
29 | private bool reccuringEvent = false;
|
---|
30 | private Guid reccuringID = Guid.Empty;
|
---|
31 | internal int conflictCount;
|
---|
32 | #endregion
|
---|
33 |
|
---|
34 |
|
---|
35 | public Appointment()
|
---|
36 | {
|
---|
37 | color = Color.White;
|
---|
38 | borderColor = Color.Blue;
|
---|
39 | Subject = "New Appointment";
|
---|
40 | }
|
---|
41 |
|
---|
42 | #region " Public Properties "
|
---|
43 | [XmlIgnore]
|
---|
44 | public int Layer
|
---|
45 | {
|
---|
46 | get { return layer; }
|
---|
47 | set { layer = value; }
|
---|
48 | }
|
---|
49 |
|
---|
50 | [XmlIgnore]
|
---|
51 | public string Group
|
---|
52 | {
|
---|
53 | get { return group; }
|
---|
54 | set { group = value; }
|
---|
55 | }
|
---|
56 |
|
---|
57 | [XmlAttribute("Locked")]
|
---|
58 | [System.ComponentModel.DefaultValue(false)]
|
---|
59 | public bool Locked
|
---|
60 | {
|
---|
61 | get
|
---|
62 | {
|
---|
63 | return locked;
|
---|
64 | }
|
---|
65 | set
|
---|
66 | {
|
---|
67 | locked = value;
|
---|
68 | OnLockedChanged();
|
---|
69 | }
|
---|
70 | }
|
---|
71 |
|
---|
72 | [XmlIgnore]
|
---|
73 | public Color Color
|
---|
74 | {
|
---|
75 | get
|
---|
76 | {
|
---|
77 | return color;
|
---|
78 | }
|
---|
79 | set
|
---|
80 | {
|
---|
81 | color = value;
|
---|
82 | OnColorChanged();
|
---|
83 | }
|
---|
84 | }
|
---|
85 |
|
---|
86 | [XmlIgnore]
|
---|
87 | public Color TextColor
|
---|
88 | {
|
---|
89 | get
|
---|
90 | {
|
---|
91 | return textColor;
|
---|
92 | }
|
---|
93 | set
|
---|
94 | {
|
---|
95 | textColor = value;
|
---|
96 | OnTextColorChanged();
|
---|
97 | }
|
---|
98 | }
|
---|
99 |
|
---|
100 | [XmlIgnore]
|
---|
101 | public Color BorderColor
|
---|
102 | {
|
---|
103 | get
|
---|
104 | {
|
---|
105 | return borderColor;
|
---|
106 | }
|
---|
107 | set
|
---|
108 | {
|
---|
109 | borderColor = value;
|
---|
110 | OnBorderColorChanged();
|
---|
111 | }
|
---|
112 | }
|
---|
113 |
|
---|
114 | [XmlIgnore]
|
---|
115 | public bool DrawBorder
|
---|
116 | {
|
---|
117 | get
|
---|
118 | {
|
---|
119 | return drawBorder;
|
---|
120 | }
|
---|
121 | set
|
---|
122 | {
|
---|
123 | drawBorder = value;
|
---|
124 | }
|
---|
125 | }
|
---|
126 |
|
---|
127 | [XmlAttribute("AllDayEvent")]
|
---|
128 | public bool AllDayEvent
|
---|
129 | {
|
---|
130 | get
|
---|
131 | {
|
---|
132 | return allDayEvent;
|
---|
133 | }
|
---|
134 | set
|
---|
135 | {
|
---|
136 | allDayEvent = value;
|
---|
137 | OnAllDayEventChanged();
|
---|
138 | }
|
---|
139 | }
|
---|
140 |
|
---|
141 | [XmlAttribute("Recurring")]
|
---|
142 | public bool Recurring
|
---|
143 | {
|
---|
144 | get
|
---|
145 | {
|
---|
146 | return reccuringEvent;
|
---|
147 | }
|
---|
148 | set
|
---|
149 | {
|
---|
150 | reccuringEvent = value;
|
---|
151 | }
|
---|
152 | }
|
---|
153 | [XmlAttribute("RecurringId")]
|
---|
154 | public Guid RecurringId {
|
---|
155 | get {
|
---|
156 | return reccuringID;
|
---|
157 | }
|
---|
158 | set {
|
---|
159 | reccuringID = value;
|
---|
160 | }
|
---|
161 | }
|
---|
162 | #endregion
|
---|
163 |
|
---|
164 | #region " Events "
|
---|
165 | protected virtual void OnStartDateChanged()
|
---|
166 | {
|
---|
167 | }
|
---|
168 | protected virtual void OnEndDateChanged()
|
---|
169 | {
|
---|
170 | }
|
---|
171 | protected virtual void OnLockedChanged()
|
---|
172 | {
|
---|
173 | }
|
---|
174 | protected virtual void OnColorChanged()
|
---|
175 | {
|
---|
176 | }
|
---|
177 | protected virtual void OnTextColorChanged()
|
---|
178 | {
|
---|
179 | }
|
---|
180 | protected virtual void OnBorderColorChanged()
|
---|
181 | {
|
---|
182 | }
|
---|
183 | protected virtual void OnTitleChanged()
|
---|
184 | {
|
---|
185 | }
|
---|
186 | protected virtual void OnAllDayEventChanged()
|
---|
187 | {
|
---|
188 | }
|
---|
189 | #endregion
|
---|
190 |
|
---|
191 | #region iAppointment Members
|
---|
192 | [XmlAttribute("StartDate")]
|
---|
193 | public DateTime StartDate
|
---|
194 | {
|
---|
195 | get
|
---|
196 | {
|
---|
197 | return startDate;
|
---|
198 | }
|
---|
199 | set
|
---|
200 | {
|
---|
201 | startDate = value;
|
---|
202 | OnStartDateChanged();
|
---|
203 |
|
---|
204 | }
|
---|
205 | }
|
---|
206 |
|
---|
207 | [XmlAttribute("EndDate")]
|
---|
208 | public DateTime EndDate
|
---|
209 | {
|
---|
210 | get
|
---|
211 | {
|
---|
212 | return endDate;
|
---|
213 | }
|
---|
214 | set
|
---|
215 | {
|
---|
216 | endDate = value;
|
---|
217 | OnEndDateChanged();
|
---|
218 | }
|
---|
219 | }
|
---|
220 |
|
---|
221 | [XmlIgnore]
|
---|
222 | public int AppointmentId
|
---|
223 | {
|
---|
224 | get
|
---|
225 | {
|
---|
226 | return appointmentId;
|
---|
227 | }
|
---|
228 | set
|
---|
229 | {
|
---|
230 | appointmentId = value;
|
---|
231 | }
|
---|
232 | }
|
---|
233 | [XmlElement("Subject")]
|
---|
234 | public string Subject
|
---|
235 | {
|
---|
236 | get
|
---|
237 | {
|
---|
238 | return subject;
|
---|
239 | }
|
---|
240 | set
|
---|
241 | {
|
---|
242 | subject = value;
|
---|
243 | }
|
---|
244 | }
|
---|
245 |
|
---|
246 | [XmlIgnore]
|
---|
247 | public string Location { get; set; }
|
---|
248 |
|
---|
249 | [XmlIgnore]
|
---|
250 | public string Note { get; set; }
|
---|
251 | #endregion
|
---|
252 | }
|
---|
253 | }
|
---|