Index: trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.cs	(revision 1087)
+++ trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.cs	(revision 1138)
@@ -34,4 +34,5 @@
 using System.ServiceModel;
 using System.Net;
+using Calendar;
 
 namespace HeuristicLab.Hive.Client.Console {
@@ -54,4 +55,6 @@
     private System.Windows.Forms.Timer refreshTimer;
     private ListViewColumnSorterDate lvwColumnSorter;
+
+    private List<Appointment> onlineTimes = new List<Appointment>();
 
     #endregion
@@ -69,4 +72,5 @@
       RefreshGui();
       GetEventLog();
+      InitCalender();
     }
 
@@ -161,5 +165,5 @@
       } else {
         for (int i = 0; i < jobs.Length; i++) {
-          allProgress += jobs[i].Progress;         
+          allProgress += jobs[i].Progress;
         }
 
@@ -167,5 +171,5 @@
 
         myPane.AddPieSlice(done, Color.Green, 0, "");
-        myPane.AddPieSlice(1-done, Color.Red, 0, "");
+        myPane.AddPieSlice(1 - done, Color.Red, 0, "");
       }
       //Hides the slice labels
@@ -175,4 +179,31 @@
 
       pbGraph.Image = zgc.GetImage();
+    }
+
+    private void InitCalender() {
+
+      dvOnline.StartDate = DateTime.Now;
+      dvOnline.OnNewAppointment += new EventHandler<NewAppointmentEventArgs>(DvOnline_OnNewAppointment);
+      dvOnline.OnResolveAppointments += new EventHandler<ResolveAppointmentsEventArgs>(DvOnline_OnResolveAppointments);
+    }
+
+    void DvOnline_OnResolveAppointments(object sender, ResolveAppointmentsEventArgs e) {
+      List<Appointment> Apps = new List<Appointment>();
+
+      foreach (Appointment m_App in onlineTimes)
+        if ((m_App.StartDate >= e.StartDate) &&
+            (m_App.StartDate <= e.EndDate))
+          Apps.Add(m_App);
+
+      e.Appointments = Apps;
+    }
+
+    void DvOnline_OnNewAppointment(object sender, NewAppointmentEventArgs e) {
+      Appointment Appointment = new Appointment();
+
+      Appointment.StartDate = e.StartDate;
+      Appointment.EndDate = e.EndDate;
+
+      onlineTimes.Add(Appointment);
     }
 
@@ -191,5 +222,5 @@
         tbPort.Text = curConnection.Port.ToString();
       } else {
-               refreshTimer.Stop();
+        refreshTimer.Stop();
         DialogResult res = MessageBox.Show("Connection Error, check if Hive Client is running! - " + e.Error.Message, "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         if (res == DialogResult.OK)
@@ -328,4 +359,51 @@
     #endregion
 
+    private void mcOnline_DateChanged(object sender, DateRangeEventArgs e) {
+      dvOnline.StartDate = mcOnline.SelectionStart;
+    }
+
+    private void btCreate_Click(object sender, EventArgs e) {
+
+      if (string.IsNullOrEmpty(txtFrom.Text)) {
+        Appointment App = new Appointment();
+        App.StartDate = dvOnline.SelectionStart;
+        App.EndDate = dvOnline.SelectionEnd;
+        App.BorderColor = Color.Red;
+        App.Locked = true;
+        App.Subject = "Online";
+        onlineTimes.Add(App);
+      } else if (string.IsNullOrEmpty(txtTimeTo.Text)) {
+        Appointment App = new Appointment();
+        App.StartDate = DateTime.Parse(txtFrom.Text);
+        App.EndDate = DateTime.Parse(txtTo.Text);
+        App.BorderColor = Color.Red;
+        App.Locked = true;
+        App.Subject = "Online";
+        onlineTimes.Add(App);
+      } else {
+        DateTime from = DateTime.Parse(txtFrom.Text);
+        DateTime to = DateTime.Parse(txtTo.Text);
+
+        while (from.Date != to.Date) {
+          Appointment App = new Appointment();
+          App.StartDate = new DateTime(from.Year, from.Month, from.Day, int.Parse(txttimeFrom.Text), 0,0);
+          App.EndDate = new DateTime(from.Year, from.Month, from.Day, int.Parse(txtTimeTo.Text), 0, 0);
+          App.BorderColor = Color.Red;
+          App.Locked = true;
+          App.Subject = "Online";
+          onlineTimes.Add(App);
+          from = from.AddDays(1);
+        }
+      }
+      
+      dvOnline.Invalidate();
+    }
+
+    private void btbDelete_Click(object sender, EventArgs e) {
+      if (dvOnline.SelectedAppointment != null)
+        onlineTimes.Remove(dvOnline.SelectedAppointment);
+      dvOnline.Invalidate();
+    }
+
   }
 }
