Index: /trunk/sources/HeuristicLab.Hive.Client.Console/HeuristicLab.Hive.Client.Console.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Console/HeuristicLab.Hive.Client.Console.csproj	(revision 1510)
+++ /trunk/sources/HeuristicLab.Hive.Client.Console/HeuristicLab.Hive.Client.Console.csproj	(revision 1511)
@@ -156,4 +156,5 @@
       <DependentUpon>Recurrence.cs</DependentUpon>
     </Compile>
+    <Compile Include="RecurrentEvent.cs" />
     <Compile Include="Service References\ClientService\Reference.cs">
       <AutoGen>True</AutoGen>
Index: /trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.Designer.cs	(revision 1510)
+++ /trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.Designer.cs	(revision 1511)
@@ -46,5 +46,5 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
-      Calendar.DrawTool drawTool2 = new Calendar.DrawTool();
+      Calendar.DrawTool drawTool1 = new Calendar.DrawTool();
       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HiveClientConsole));
       this.dvOnline = new Calendar.DayView();
@@ -115,6 +115,6 @@
       // dvOnline
       // 
-      drawTool2.DayView = this.dvOnline;
-      this.dvOnline.ActiveTool = drawTool2;
+      drawTool1.DayView = this.dvOnline;
+      this.dvOnline.ActiveTool = drawTool1;
       this.dvOnline.AmPmDisplay = false;
       this.dvOnline.AppointmentDuration = Calendar.AppointmentSlotDuration.SixtyMinutes;
@@ -529,7 +529,7 @@
       this.groupBox1.Controls.Add(this.label1);
       this.groupBox1.Controls.Add(this.btCreate);
-      this.groupBox1.Location = new System.Drawing.Point(353, 7);
+      this.groupBox1.Location = new System.Drawing.Point(373, 7);
       this.groupBox1.Name = "groupBox1";
-      this.groupBox1.Size = new System.Drawing.Size(274, 161);
+      this.groupBox1.Size = new System.Drawing.Size(254, 161);
       this.groupBox1.TabIndex = 21;
       this.groupBox1.TabStop = false;
@@ -539,5 +539,5 @@
       this.txttimeTo.CustomFormat = "HH:00";
       this.txttimeTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
-      this.txttimeTo.Location = new System.Drawing.Point(189, 64);
+      this.txttimeTo.Location = new System.Drawing.Point(164, 45);
       this.txttimeTo.Name = "txttimeTo";
       this.txttimeTo.ShowUpDown = true;
@@ -549,5 +549,5 @@
       this.txttimeFrom.CustomFormat = "HH:00";
       this.txttimeFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
-      this.txttimeFrom.Location = new System.Drawing.Point(189, 31);
+      this.txttimeFrom.Location = new System.Drawing.Point(164, 12);
       this.txttimeFrom.Name = "txttimeFrom";
       this.txttimeFrom.ShowUpDown = true;
@@ -558,5 +558,5 @@
       // 
       this.dtpTo.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
-      this.dtpTo.Location = new System.Drawing.Point(97, 64);
+      this.dtpTo.Location = new System.Drawing.Point(72, 45);
       this.dtpTo.Name = "dtpTo";
       this.dtpTo.Size = new System.Drawing.Size(89, 20);
@@ -566,5 +566,5 @@
       // 
       this.dtpFrom.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
-      this.dtpFrom.Location = new System.Drawing.Point(97, 31);
+      this.dtpFrom.Location = new System.Drawing.Point(72, 12);
       this.dtpFrom.Name = "dtpFrom";
       this.dtpFrom.Size = new System.Drawing.Size(89, 20);
@@ -574,5 +574,5 @@
       // 
       this.chbade.AutoSize = true;
-      this.chbade.Location = new System.Drawing.Point(97, 90);
+      this.chbade.Location = new System.Drawing.Point(72, 71);
       this.chbade.Name = "chbade";
       this.chbade.Size = new System.Drawing.Size(90, 17);
@@ -584,7 +584,7 @@
       // btnRecurrence
       // 
-      this.btnRecurrence.Location = new System.Drawing.Point(189, 129);
+      this.btnRecurrence.Location = new System.Drawing.Point(141, 129);
       this.btnRecurrence.Name = "btnRecurrence";
-      this.btnRecurrence.Size = new System.Drawing.Size(75, 26);
+      this.btnRecurrence.Size = new System.Drawing.Size(113, 26);
       this.btnRecurrence.TabIndex = 30;
       this.btnRecurrence.Text = "Recurrence";
@@ -594,7 +594,7 @@
       // btbDelete
       // 
-      this.btbDelete.Location = new System.Drawing.Point(100, 129);
+      this.btbDelete.Location = new System.Drawing.Point(8, 129);
       this.btbDelete.Name = "btbDelete";
-      this.btbDelete.Size = new System.Drawing.Size(75, 26);
+      this.btbDelete.Size = new System.Drawing.Size(114, 26);
       this.btbDelete.TabIndex = 25;
       this.btbDelete.Text = "Delete";
@@ -605,5 +605,5 @@
       // 
       this.label2.AutoSize = true;
-      this.label2.Location = new System.Drawing.Point(41, 65);
+      this.label2.Location = new System.Drawing.Point(16, 46);
       this.label2.Name = "label2";
       this.label2.Size = new System.Drawing.Size(55, 13);
@@ -614,5 +614,5 @@
       // 
       this.label1.AutoSize = true;
-      this.label1.Location = new System.Drawing.Point(41, 34);
+      this.label1.Location = new System.Drawing.Point(16, 15);
       this.label1.Name = "label1";
       this.label1.Size = new System.Drawing.Size(58, 13);
@@ -622,7 +622,7 @@
       // btCreate
       // 
-      this.btCreate.Location = new System.Drawing.Point(11, 129);
+      this.btCreate.Location = new System.Drawing.Point(6, 93);
       this.btCreate.Name = "btCreate";
-      this.btCreate.Size = new System.Drawing.Size(75, 26);
+      this.btCreate.Size = new System.Drawing.Size(242, 26);
       this.btCreate.TabIndex = 20;
       this.btCreate.Text = "Save";
Index: /trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.cs	(revision 1510)
+++ /trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.cs	(revision 1511)
@@ -22,28 +22,26 @@
 using System;
 using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
+using System.Diagnostics;
 using System.Drawing;
 using System.Linq;
-using System.Text;
+using System.Net;
+using System.ServiceModel;
 using System.Windows.Forms;
-using System.Diagnostics;
-using System.Threading;
+using Calendar;
+using HeuristicLab.Hive.Client.Console.ClientService;
 using ZedGraph;
-using HeuristicLab.Hive.Client.Console.ClientService;
-using System.ServiceModel;
-using System.Net;
-using Calendar;
-using System.Globalization;
-
-namespace HeuristicLab.Hive.Client.Console {
+
+namespace HeuristicLab.Hive.Client.Console
+{
 
   #region Delegates
 
-  delegate void UpdateTextDelegate(EventLogEntry ev);
+  public delegate void UpdateTextDelegate(EventLogEntry ev);
+  public delegate void OnDialogClosedDelegate(RecurrentEvent e);
 
   #endregion
 
-  public partial class HiveClientConsole : Form {
+  public partial class HiveClientConsole : Form
+  {
 
     #region Declarations
@@ -59,9 +57,12 @@
     private List<Appointment> onlineTimes = new List<Appointment>();
 
+    public OnDialogClosedDelegate dialogClosedDelegate;
+
     #endregion
 
     #region Constructor
 
-    public HiveClientConsole() {
+    public HiveClientConsole()
+    {
       InitializeComponent();
       lvwColumnSorter = new ListViewColumnSorterDate();
@@ -80,5 +81,6 @@
     #region Methods
 
-    private void InitTimer() {
+    private void InitTimer()
+    {
       refreshTimer = new System.Windows.Forms.Timer();
       refreshTimer.Interval = 1000;
@@ -87,9 +89,12 @@
     }
 
-    private void RefreshGui() {
-      try {
+    private void RefreshGui()
+    {
+      try
+      {
         cccc.GetStatusInfosAsync();
       }
-      catch (Exception ex) {
+      catch (Exception ex)
+      {
         refreshTimer.Stop();
         DialogResult res = MessageBox.Show("Connection Error, check if Hive Client is running!", "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
@@ -99,11 +104,14 @@
     }
 
-    private void ConnectToClient() {
-      try {
+    private void ConnectToClient()
+    {
+      try
+      {
         cccc = new ClientConsoleCommunicatorClient(new NetTcpBinding(), new EndpointAddress(ENDPOINTADRESS));
         cccc.GetStatusInfosCompleted += new EventHandler<GetStatusInfosCompletedEventArgs>(cccc_GetStatusInfosCompleted);
         cccc.GetCurrentConnectionCompleted += new EventHandler<GetCurrentConnectionCompletedEventArgs>(cccc_GetCurrentConnectionCompleted);
       }
-      catch (Exception) {
+      catch (Exception)
+      {
         refreshTimer.Stop();
         DialogResult res = MessageBox.Show("Connection Error, check if Hive Client is running!", "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
@@ -113,5 +121,6 @@
     }
 
-    private void GetEventLog() {
+    private void GetEventLog()
+    {
       HiveClientEventLog = new EventLog(EVENTLOGNAME);
       HiveClientEventLog.Source = EVENTLOGNAME;
@@ -122,6 +131,8 @@
 
       //databinding on listview?
-      if (HiveClientEventLog != null && HiveClientEventLog.Entries != null) {
-        foreach (EventLogEntry ele in HiveClientEventLog.Entries) {
+      if (HiveClientEventLog != null && HiveClientEventLog.Entries != null)
+      {
+        foreach (EventLogEntry ele in HiveClientEventLog.Entries)
+        {
           curEventLogEntry = GenerateEventEntry(ele);
           lvLog.Items.Add(curEventLogEntry);
@@ -131,5 +142,6 @@
     }
 
-    private ListViewItem GenerateEventEntry(EventLogEntry ele) {
+    private ListViewItem GenerateEventEntry(EventLogEntry ele)
+    {
       ListViewItem curEventLogEntry;
       curEventLogEntry = new ListViewItem("", 0);
@@ -142,5 +154,6 @@
     }
 
-    private void UpdateGraph(JobStatus[] jobs) {
+    private void UpdateGraph(JobStatus[] jobs)
+    {
       ZedGraphControl zgc = new ZedGraphControl();
       GraphPane myPane = zgc.GraphPane;
@@ -162,8 +175,12 @@
       double done = 0;
 
-      if (jobs.Length == 0) {
+      if (jobs.Length == 0)
+      {
         myPane.AddPieSlice(100, Color.Green, 0.1, "");
-      } else {
-        for (int i = 0; i < jobs.Length; i++) {
+      }
+      else
+      {
+        for (int i = 0; i < jobs.Length; i++)
+        {
           allProgress += jobs[i].Progress;
         }
@@ -182,5 +199,6 @@
     }
 
-    private void InitCalender() {
+    private void InitCalender()
+    {
       dvOnline.StartDate = DateTime.Now;
       dvOnline.OnNewAppointment += new EventHandler<NewAppointmentEventArgs>(DvOnline_OnNewAppointment);
@@ -188,5 +206,6 @@
     }
 
-    private Appointment CreateAppointment(DateTime startDate, DateTime endDate, bool allDay) {
+    private Appointment CreateAppointment(DateTime startDate, DateTime endDate, bool allDay)
+    {
       Appointment App = new Appointment();
       App.StartDate = startDate;
@@ -196,8 +215,31 @@
       App.Locked = true;
       App.Subject = "Online";
+      App.Recurring = false;
       return App;
     }
 
-    //private ConvertToAppointments(List<
+    private Appointment CreateAppointment(DateTime startDate, DateTime endDate, bool allDay, bool recurring, Guid recurringId)
+    {
+      Appointment App = new Appointment();
+      App.StartDate = startDate;
+      App.EndDate = endDate;
+      App.AllDayEvent = allDay;
+      App.BorderColor = Color.Red;
+      App.Locked = true;
+      App.Subject = "Online";
+      App.Recurring = recurring;
+      App.RecurringId = recurringId;
+      return App;
+    }
+
+    private void DeleteAppointment()
+    {
+      onlineTimes.Remove(dvOnline.SelectedAppointment);
+    }
+
+    private void DeleteRecurringAppointment(Guid recurringId)
+    {
+      onlineTimes.RemoveAll(a => a.RecurringId.ToString() == dvOnline.SelectedAppointment.RecurringId.ToString());
+    }
 
     #endregion
@@ -205,14 +247,19 @@
     #region Events
 
-    private void refreshTimer_Tick(object sender, EventArgs e) {
+    private void refreshTimer_Tick(object sender, EventArgs e)
+    {
       RefreshGui();
     }
 
-    private void cccc_GetCurrentConnectionCompleted(object sender, GetCurrentConnectionCompletedEventArgs e) {
-      if (e.Error == null) {
+    private void cccc_GetCurrentConnectionCompleted(object sender, GetCurrentConnectionCompletedEventArgs e)
+    {
+      if (e.Error == null)
+      {
         ConnectionContainer curConnection = e.Result;
         tbIPAdress.Text = curConnection.IPAdress;
         tbPort.Text = curConnection.Port.ToString();
-      } else {
+      }
+      else
+      {
         refreshTimer.Stop();
         DialogResult res = MessageBox.Show("Connection Error, check if Hive Client is running! - " + e.Error.Message, "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
@@ -222,7 +269,9 @@
     }
 
-    private void cccc_GetStatusInfosCompleted(object sender, GetStatusInfosCompletedEventArgs e) {
-
-      if (e.Error == null) {
+    private void cccc_GetStatusInfosCompleted(object sender, GetStatusInfosCompletedEventArgs e)
+    {
+
+      if (e.Error == null)
+      {
         StatusCommons sc = e.Result;
 
@@ -237,8 +286,10 @@
         ListViewItem curJobStatusItem;
 
-        if (sc.Jobs != null) {
+        if (sc.Jobs != null)
+        {
           lvJobDetail.Items.Clear();
           double progress;
-          foreach (JobStatus curJob in sc.Jobs) {
+          foreach (JobStatus curJob in sc.Jobs)
+          {
             curJobStatusItem = new ListViewItem(curJob.JobId.ToString());
             curJobStatusItem.SubItems.Add(curJob.Since.ToString());
@@ -252,14 +303,19 @@
         UpdateGraph(sc.Jobs);
 
-        if (sc.Status == NetworkEnumWcfConnState.Connected || sc.Status == NetworkEnumWcfConnState.Loggedin) {
+        if (sc.Status == NetworkEnumWcfConnState.Connected || sc.Status == NetworkEnumWcfConnState.Loggedin)
+        {
           btConnect.Enabled = false;
           btnDisconnect.Enabled = true;
           lbCs.Text = sc.ConnectedSince.ToString();
           cccc.GetCurrentConnectionAsync();
-        } else if (sc.Status == NetworkEnumWcfConnState.Disconnected) {
+        }
+        else if (sc.Status == NetworkEnumWcfConnState.Disconnected)
+        {
           btConnect.Enabled = true;
           btnDisconnect.Enabled = false;
           lbCs.Text = String.Empty;
-        } else if (sc.Status == NetworkEnumWcfConnState.Failed) {
+        }
+        else if (sc.Status == NetworkEnumWcfConnState.Failed)
+        {
           btConnect.Enabled = true;
           btnDisconnect.Enabled = false;
@@ -268,5 +324,7 @@
 
         cccc.GetCurrentConnection();
-      } else {
+      }
+      else
+      {
         refreshTimer.Stop();
         DialogResult res = MessageBox.Show("Connection Error, check if Hive Client is running! - " + e.Error.Message, "Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
@@ -276,13 +334,18 @@
     }
 
-    private void HiveClientConsole_Load(object sender, EventArgs e) {
+    private void HiveClientConsole_Load(object sender, EventArgs e)
+    {
       //nothing to do
     }
 
-    private void UpdateText(EventLogEntry ev) {
-      if (this.lvLog.InvokeRequired) {
+    private void UpdateText(EventLogEntry ev)
+    {
+      if (this.lvLog.InvokeRequired)
+      {
         this.lvLog.Invoke(new
           UpdateTextDelegate(UpdateText), new object[] { ev });
-      } else {
+      }
+      else
+      {
         ListViewItem curEventLogEntry = GenerateEventEntry(ev);
         lvLog.Items.Add(curEventLogEntry);
@@ -291,9 +354,11 @@
     }
 
-    public void OnEntryWritten(object source, EntryWrittenEventArgs e) {
+    public void OnEntryWritten(object source, EntryWrittenEventArgs e)
+    {
       UpdateText(e.Entry);
     }
 
-    private void lvLog_DoubleClick(object sender, EventArgs e) {
+    private void lvLog_DoubleClick(object sender, EventArgs e)
+    {
       ListViewItem lvi = lvLog.SelectedItems[0];
       HiveEventEntry hee = new HiveEventEntry(lvi.SubItems[2].Text, lvi.SubItems[3].Text, lvi.SubItems[1].Text);
@@ -303,31 +368,43 @@
     }
 
-    private void btConnect_Click(object sender, EventArgs e) {
+    private void btConnect_Click(object sender, EventArgs e)
+    {
       IPAddress ipAdress;
       int port;
       ConnectionContainer cc = new ConnectionContainer();
-      if (IPAddress.TryParse(tbIPAdress.Text, out ipAdress) && int.TryParse(tbPort.Text, out port)) {
+      if (IPAddress.TryParse(tbIPAdress.Text, out ipAdress) && int.TryParse(tbPort.Text, out port))
+      {
         cc.IPAdress = tbIPAdress.Text;
         cc.Port = port;
         cccc.SetConnectionAsync(cc);
-      } else {
+      }
+      else
+      {
         MessageBox.Show("IP Adress and/or Port Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
       }
     }
 
-    private void btnDisconnect_Click(object sender, EventArgs e) {
+    private void btnDisconnect_Click(object sender, EventArgs e)
+    {
       cccc.DisconnectAsync();
     }
 
-    private void lvLog_ColumnClick(object sender, ColumnClickEventArgs e) {
+    private void lvLog_ColumnClick(object sender, ColumnClickEventArgs e)
+    {
       // Determine if clicked column is already the column that is being sorted.
-      if (e.Column == lvwColumnSorter.SortColumn) {
+      if (e.Column == lvwColumnSorter.SortColumn)
+      {
         // Reverse the current sort direction for this column.
-        if (lvwColumnSorter.Order == SortOrder.Ascending) {
+        if (lvwColumnSorter.Order == SortOrder.Ascending)
+        {
           lvwColumnSorter.Order = SortOrder.Descending;
-        } else {
+        }
+        else
+        {
           lvwColumnSorter.Order = SortOrder.Ascending;
         }
-      } else {
+      }
+      else
+      {
         // Set the column number that is to be sorted; default to ascending.
         lvwColumnSorter.SortColumn = e.Column;
@@ -339,7 +416,9 @@
     }
 
-    private void btn_clientShutdown_Click(object sender, EventArgs e) {
+    private void btn_clientShutdown_Click(object sender, EventArgs e)
+    {
       DialogResult res = MessageBox.Show("Do you really want to shutdown the Hive Client?", "Hive Client Console", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
-      if (res == DialogResult.Yes) {
+      if (res == DialogResult.Yes)
+      {
         cccc.ShutdownClient();
         this.Close();
@@ -347,45 +426,80 @@
     }
 
-    private void btbDelete_Click(object sender, EventArgs e) {
+    private void btbDelete_Click(object sender, EventArgs e)
+    {
+      Appointment selectedAppointment = dvOnline.SelectedAppointment;
       if (dvOnline.SelectedAppointment != null)
-        onlineTimes.Remove(dvOnline.SelectedAppointment);
+      {
+        if (!selectedAppointment.Recurring)
+          DeleteAppointment();
+        else
+        {
+          DialogResult res = MessageBox.Show("Delete all events in this series?", "Delete recurrences", MessageBoxButtons.YesNo);
+          if (res != DialogResult.Yes)
+            DeleteAppointment();
+          else
+            DeleteRecurringAppointment(selectedAppointment.RecurringId);
+        }
+      }
       dvOnline.Invalidate();
     }
 
-    private void chbade_CheckedChanged(object sender, EventArgs e) {
-      //if (chbade.Checked) {
-      //  txttimeFrom.Visible = false;
-      //  txttimeTo.Visible = false;
-      //} else {
-      //  txttimeFrom.Visible = true;
-      //  txttimeTo.Visible = true;
-      //}
+    private void chbade_CheckedChanged(object sender, EventArgs e)
+    {
       txttimeFrom.Visible = !chbade.Checked;
       txttimeTo.Visible = !chbade.Checked;
     }
 
-    private void dvOnline_OnSelectionChanged(object sender, EventArgs e) {
-      if (dvOnline.Selection == SelectionType.DateRange) {
+    private void dvOnline_OnSelectionChanged(object sender, EventArgs e)
+    {
+      if (dvOnline.Selection == SelectionType.DateRange)
+      {
         dtpFrom.Text = dvOnline.SelectionStart.ToShortDateString();
         dtpTo.Text = dvOnline.SelectionEnd.Date.ToShortDateString();
         txttimeFrom.Text = dvOnline.SelectionStart.ToShortTimeString();
         txttimeTo.Text = dvOnline.SelectionEnd.ToShortTimeString();
-      }
-    }
-
-    private void Connection_KeyPress(object sender, KeyPressEventArgs e) {
+
+        btCreate.Text = "Save";
+      }
+
+      if (dvOnline.Selection == SelectionType.Appointment)
+      {
+
+        dtpFrom.Text = dvOnline.SelectedAppointment.StartDate.ToShortDateString();
+        dtpTo.Text = dvOnline.SelectedAppointment.EndDate.ToShortDateString();
+        txttimeFrom.Text = dvOnline.SelectedAppointment.StartDate.ToShortTimeString();
+        txttimeTo.Text = dvOnline.SelectedAppointment.EndDate.ToShortTimeString();
+
+        //also change the caption of the save button
+        btCreate.Text = "Save changes";
+      }
+
+      if (dvOnline.Selection == SelectionType.None)
+      {
+        //also change the caption of the save button
+        btCreate.Text = "Save";
+      }
+
+    }
+
+    private void Connection_KeyPress(object sender, KeyPressEventArgs e)
+    {
       if (e.KeyChar == (char)Keys.Return)
         btConnect_Click(null, null);
     }
 
-    private void mcOnline_DateChanged(object sender, DateRangeEventArgs e) {
+    private void mcOnline_DateChanged(object sender, DateRangeEventArgs e)
+    {
       dvOnline.StartDate = mcOnline.SelectionStart;
     }
 
-    private void btCreate_Click(object sender, EventArgs e) {
+    private bool CreateAppointment()
+    {
       DateTime from, to;
 
-      if (!string.IsNullOrEmpty(dtpFrom.Text) && !string.IsNullOrEmpty(dtpTo.Text)) {
-        if (chbade.Checked) {
+      if (!string.IsNullOrEmpty(dtpFrom.Text) && !string.IsNullOrEmpty(dtpTo.Text))
+      {
+        if (chbade.Checked)
+        {
           //whole day appointment, only dates are visible
           if (DateTime.TryParse(dtpFrom.Text + " " + txttimeFrom.Text, out from) && DateTime.TryParse(dtpTo.Text + " " + txttimeTo.Text, out to) && from < to)
@@ -393,12 +507,17 @@
           else
             MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
-        } else if (!string.IsNullOrEmpty(txttimeFrom.Text) && !string.IsNullOrEmpty(txttimeTo.Text)) {
+        }
+        else if (!string.IsNullOrEmpty(txttimeFrom.Text) && !string.IsNullOrEmpty(txttimeTo.Text))
+        {
           //Timeframe appointment
-          if (DateTime.TryParse(dtpFrom.Text + " " + txttimeFrom.Text, out from) && DateTime.TryParse(dtpTo.Text + " " + txttimeTo.Text, out to) && from < to) {
+          if (DateTime.TryParse(dtpFrom.Text + " " + txttimeFrom.Text, out from) && DateTime.TryParse(dtpTo.Text + " " + txttimeTo.Text, out to) && from < to)
+          {
             if (from.Date == to.Date)
               onlineTimes.Add(CreateAppointment(from, to, false));
-            else {
+            else
+            {
               //more than 1 day selected
-              while (from.Date != to.Date) {
+              while (from.Date != to.Date)
+              {
                 onlineTimes.Add(CreateAppointment(from, new DateTime(from.Year, from.Month, from.Day, to.Hour, to.Minute, 0, 0), false));
                 from = from.AddDays(1);
@@ -406,14 +525,60 @@
               onlineTimes.Add(CreateAppointment(from, new DateTime(from.Year, from.Month, from.Day, to.Hour, to.Minute, 0, 0), false));
             }
-          } else
+          }
+          else
             MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         dvOnline.Invalidate();
-      } else {
+        return true;
+      }
+      else
+      {
         MessageBox.Show("Error in create appointment, please fill out all textboxes!", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
-      }
-    }
-
-    void DvOnline_OnResolveAppointments(object sender, ResolveAppointmentsEventArgs e) {
+        return false;
+      }
+    }
+
+    private void btCreate_Click(object sender, EventArgs e)
+    {
+      if (dvOnline.Selection != SelectionType.Appointment)
+      {
+        CreateAppointment();
+      }
+      else
+      {
+        //now we want to change an existing appointment
+        if (!dvOnline.SelectedAppointment.Recurring)
+        {
+          if (CreateAppointment())
+            DeleteAppointment();
+        }
+        else
+        {
+          //change recurring appointment
+          //check, if only selected appointment has to change or whole recurrence
+          DialogResult res = MessageBox.Show("Change all events in this series?", "Change recurrences", MessageBoxButtons.YesNo);
+          if (res != DialogResult.Yes)
+          {
+            if (CreateAppointment())
+              DeleteAppointment();
+          }
+          else
+            ChangeRecurrenceAppointment(dvOnline.SelectedAppointment.RecurringId);
+        }
+      }
+    }
+
+    private void ChangeRecurrenceAppointment(Guid recurringId)
+    {
+      List<Appointment> recurringAppointments = onlineTimes.Where(appointment => appointment.RecurringId == recurringId).ToList();
+      recurringAppointments.ForEach(appointment => appointment.StartDate = DateTime.Parse(appointment.StartDate.Date + " " + txttimeFrom.Text));
+      recurringAppointments.ForEach(appointment => appointment.EndDate = DateTime.Parse(appointment.EndDate.Date + " " + txttimeTo.Text));
+
+      DeleteRecurringAppointment(recurringId);
+      onlineTimes.AddRange(recurringAppointments);
+    }
+
+    private void DvOnline_OnResolveAppointments(object sender, ResolveAppointmentsEventArgs e)
+    {
       List<Appointment> Apps = new List<Appointment>();
 
@@ -425,5 +590,6 @@
     }
 
-    void DvOnline_OnNewAppointment(object sender, NewAppointmentEventArgs e) {
+    private void DvOnline_OnNewAppointment(object sender, NewAppointmentEventArgs e)
+    {
       Appointment Appointment = new Appointment();
 
@@ -434,11 +600,32 @@
     }
 
-    private void btnRecurrence_Click(object sender, EventArgs e) {
-      Form recurrence = new Recurrence();
+    private void btnRecurrence_Click(object sender, EventArgs e)
+    {
+      Recurrence recurrence = new Recurrence();
+      recurrence.dialogClosedDelegate = new OnDialogClosedDelegate(this.DialogClosed);
       recurrence.Show();
     }
 
+    public void DialogClosed(RecurrentEvent e)
+    {
+      CreateDailyRecurrenceAppointments(e.DateFrom, e.DateTo, e.AllDay, e.IncWeeks, e.WeekDays);
+    }
+
     #endregion
 
+    private void CreateDailyRecurrenceAppointments(DateTime dateFrom, DateTime dateTo, bool allDay, int incWeek, HashSet<DayOfWeek> daysOfWeek)
+    {
+      DateTime incDate = dateFrom;
+      Guid guid = Guid.NewGuid();
+
+      while (incDate.Date <= dateTo.Date)
+      {
+        if (daysOfWeek.Contains(incDate.Date.DayOfWeek))
+          onlineTimes.Add(CreateAppointment(incDate, new DateTime(incDate.Year, incDate.Month, incDate.Day, dateTo.Hour, dateTo.Minute, 0), allDay, true, guid));
+        incDate = incDate.AddDays(1);
+      }
+
+      dvOnline.Invalidate();
+    }
   }
 }
Index: /trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.resx
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.resx	(revision 1510)
+++ /trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.resx	(revision 1511)
@@ -125,50 +125,50 @@
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
-        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABS
+        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABQ
         CgAAAk1TRnQBSQFMAgEBAgEAAQQBAAEEAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
-        AwABEAMAAQEBAAEgBgABECoAAUMCAQF0AWYCCQHxAx0B/wFiAgMB1AEgAgEBLCwAAUMCAQF0AWYCCQHx
-        Ax0B/wFiAgMB1AEgAgEBLKQAAWACCgHyAZMBdwEdAf8BvwGBAR0B/wG9AYEBHQH/AboBgQEdAf8BuAGB
-        AR0B/wG2AYEBHQH/AVEBOgEdAf8BPQIBAWUcAAFgAgoB8gIdAaQB/wIdAdYB/wIdAdQB/wIdAdIB/wId
-        AdAB/wIdAc4B/wIdAV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Af8B1wGOAR0B/wHX
-        AY4BHQH/AdYBjQEdAf8BxAGBAR0B/wGpAX4BHQH/CAABWAICAbIBHQEnAe8B/wIdAe0B/wIdAekB/wId
-        AekB/wLhAfwB/wIdAekB/wIdAekB/wIdAekB/wKBAfMB/wIdAekB/wIdAegB/wIdAdoB/wEdASUBnQH/
-        jAABVwE8AR0B/wHdAZcBHQH/AdsBlAEdAf8B2wGUAR0B/wHbAZQBHQH/AdsBlAEdAf8B3AGXASMB/wHb
-        AZQBHQH/AdsBlAEdAf8B1QGMAR0B/wHJAYEBHQH/AdEBiAEdAf8BLAIdAfwMAAIdAVEB/wIdAe8B/wId
-        Ae0B/wIdAe0B/wIdAe0B/wIdAe0B/wIdAe0B/wIdAe0B/wIdAe0B/wIdAegB/wIdAd4B/wEdATAB4gH/
-        ASwCHQH8jAABGQIBASEBkAFxAR0B/wHfAZkBHQH/AdsBlAEdAf8B2QGRAR0B/wHYAZABHQH/AdgBkAEd
-        Af8B0wGKAR0B/wHQAYYBHQH/Ac4BgwEdAf8B2gGSAR0B/wEoASMBHQH/EAABGQIBASECHQGHAf8BHQEj
-        AfEB/wIdAe0B/wIdAewB/wIdAesB/wIdAesB/wIdAeYB/wIdAeQB/wIdAeIB/wEdAToB5gH/Ah0BJwH/
-        lAABEgIBARYBQgE0AR0B/wHSAYkBHQH/AeIBnQEdAf8B2QGRAR0B/wHXAY4BHQH/AdUBjAEdAf8B4QGb
-        AR0B/wHOAYQBHQH/AToCHQH+GAABEgIBARYCHQFBAf8BHQEjAdMB/wEdATQB9AH/Ah0B7AH/Ah0B6QH/
-        AR0BHgHoAf8BHQE8AfAB/wIdAcwB/wE6Ah0B/qAAAUYCAQF9Ax0B/wFuAVUBHQH/AYEBbgEdAf8BTwFA
-        AR0B/wE6Ah0B/gEUAgEBGiQAAUYCAQF9Ax0B/wIdAXEB/wIdAYEB/wIdAVEB/wE6Ah0B/gEUAgEBGv8A
-        kQABQgFNAT4HAAE+AwABKAMAAUADAAEQAwABAQEAAQEFAAGAFwAD/wEAAfwBHwH8AR8EAAHwAQcB8AEH
-        BAAB4AEDAeABAwQAAcABAQHAAQEEAAGAAQEBgAEBBAABgAEAAYAFAAGAAQABgAUAAYABAAGABQABgAEA
-        AYAFAAGAAQABgAUAAYABAQGAAQEEAAHAAQEBwAEBBAABwAEDAcABAwQAAeABBwHgAQcEAAH4AQ8B+AEP
-        BAAE/wQACw==
+        AwABEAMAAQEBAAEgBgABECoAAUMCAQF0AWYCCQHxAyEB/wFiAgMB1AEgAgEBLCwAAUMCAQF0AWYCCQHx
+        AyEB/wFiAgMB1AEgAgEBLKQAAWACCgHyAZMBewEhAf8BvwGBASEB/wG9AYEBIQH/AboBgQEhAf8BuAGB
+        ASEB/wG2AYEBIQH/AVUBPgEhAf8BPQIBAWUcAAFgAgoB8gIhAaQB/wIhAdYB/wIhAdQB/wIhAdIB/wIh
+        AdAB/wIhAc4B/wIhAVwB/wE9AgEBZZgAASsBJwEhAf8BxwGBASEB/wHDAYEBIQH/AbEBgQEhAf8BsQGB
+        ASEB/wGxAYEBIQH/AbEBgQEhAf8BswGBASEB/wG2AYEBIQH/AbQBgQEhAf8BZAIFAeQUAAIhASwB/wIh
+        AdwB/wIhAdkB/wIhAcoB/wIhAcoB/wIhAcoB/wIhAcoB/wIhAcsB/wIhAc4B/wIhAcwB/wFkAgUB5JAA
+        AyEB/wHLAYEBIQH/AbsBgQEhAf8BtgGBASEB/wG2AYEBIQH/Ae4B3AHEBf8BvgGBAT4B/wG2AYEBIQH/
+        AbYBgQEhAf8BtgGBASEB/wG0AYEBIQH/AUkCAgGGDAADIQH/AiEB4AH/AiEB0gH/AiEBzgH/Ak4B1gH/
+        AiEBzgH/AiEBzgH/AiEBzgH/AiQBzgH/AiEBzgH/AiEBzgH/AiEBzAH/AUkCAgGGiAABLAIBAUIB0AGG
+        ASEB/wHHAYEBIQH/AboBgQEhAf8BugGBASEB/wG6AYEBIQH/AdABnAFyBf8BugGBASEB/wG6AYEBIQH/
+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QQAASEBJgF4Af8CIQHsAf8CIQHiAf8CIQHiAf8C9AH9
+        Ff8CZwHqAf8CIQHiAf8CIQHiAf8CIQHUAf8BUQITAfmEAAEkASIBIQH/AdsBlAEhAf8B0gGJASEB/wHS
+        AYkBIQH/AdIBiQEhAf8B0gGJASEB/wHSAYkBIQH/AesBywGQAf8B0gGJASEB/wHSAYkBIQH/AdIBiQEh
+        Af8B0gGJASEB/wHEAYEBIQH/Ab8BgQEhAf8BUQICAZsEAAIhASQB/wIhAe0B/wIhAeYB/wIhAeUB/wL9
+        Af4F/wLiAfwB/wIhAeUJ/wKBAfEB/wIhAeUB/wIhAdoB/wIhAdYB/wFRAgIBm4QAAVgCAgGyAd4BmAEh
+        Af8B2wGUASEB/wHXAY4BIQH/AdcBjgEhAf8B1wGOASEB/wH7AfYB6wX/AdcBjgEhAf8B1wGOASEB/wHX
+        AY4BIQH/AdYBjQEhAf8BxAGBASEB/wGpAYEBIQH/CAABWAICAbIBIQErAe8B/wIhAe0B/wIhAekB/wIh
+        AekB/wLhAfwB/wIhAekB/wIhAekB/wIhAekB/wKBAfMB/wIhAekB/wIhAegB/wIhAdoB/wEhASkBnQH/
+        jAABWwFAASEB/wHdAZcBIQH/AdsBlAEhAf8B2wGUASEB/wHbAZQBIQH/AdsBlAEhAf8B3AGXAScB/wHb
+        AZQBIQH/AdsBlAEhAf8B1QGMASEB/wHJAYEBIQH/AdEBiAEhAf8BLAIhAfwMAAIhAVUB/wIhAe8B/wIh
+        Ae0B/wIhAe0B/wIhAe0B/wIhAe0B/wIhAe0B/wIhAe0B/wIhAe0B/wIhAegB/wIhAd4B/wEhATQB4gH/
+        ASwCIQH8jAABGQIBASEBkAF1ASEB/wHfAZkBIQH/AdsBlAEhAf8B2QGRASEB/wHYAZABIQH/AdgBkAEh
+        Af8B0wGKASEB/wHQAYYBIQH/Ac4BgwEhAf8B2gGSASEB/wEsAScBIQH/EAABGQIBAyEBhwH/ASEBJwHx
+        Af8CIQHtAf8CIQHsAf8CIQHrAf8CIQHrAf8CIQHmAf8CIQHkAf8CIQHiAf8BIQE+AeYB/wIhASsB/5QA
+        ARICAQEWAUYBOAEhAf8B0gGJASEB/wHiAZ0BIQH/AdkBkQEhAf8B1wGOASEB/wHVAYwBIQH/AeEBmwEh
+        Af8BzgGEASEB/wFBAiEB/hgAARICAQEWAiEBRQH/ASEBJwHTAf8BIQE4AfQB/wIhAewB/wIhAekB/wEh
+        ASIB6AH/ASEBQAHwAf8CIQHMAf8BQQIhAf6gAAFGAgEBfQMhAf8BcgFZASEB/wGBAXIBIQH/AVMBRAEh
+        Af8BQQIhAf4BFAIBARokAAFGAgEBfQMhAf8CIQF1Af8CIQGBAf8CIQFVAf8BQQIhAf4BFAIBARr/AJEA
+        AUIBTQE+BwABPgMAASgDAAFAAwABEAMAAQEBAAEBBQABgBcAA/8BAAH8AR8B/AEfBAAB8AEHAfABBwQA
+        AeABAwHgAQMEAAHAAQEBwAEBBAABgAEBAYABAQQAAYABAAGABQABgAEAAYAFAAGAAQABgAUAAYABAAGA
+        BQABgAEAAYAFAAGAAQEBgAEBBAABwAEBAcABAQQAAcABAwHAAQMEAAHgAQcB4AEHBAAB+AEPAfgBDwQA
+        BP8EAAs=
 </value>
   </data>
Index: /trunk/sources/HeuristicLab.Hive.Client.Console/Recurrence.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Console/Recurrence.Designer.cs	(revision 1510)
+++ /trunk/sources/HeuristicLab.Hive.Client.Console/Recurrence.Designer.cs	(revision 1511)
@@ -1,4 +1,6 @@
-﻿namespace HeuristicLab.Hive.Client.Console {
-  partial class Recurrence {
+﻿namespace HeuristicLab.Hive.Client.Console
+{
+  partial class Recurrence
+  {
     /// <summary>
     /// Required designer variable.
@@ -10,6 +12,8 @@
     /// </summary>
     /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing && (components != null)) {
+    protected override void Dispose(bool disposing)
+    {
+      if (disposing && (components != null))
+      {
         components.Dispose();
       }
@@ -23,5 +27,6 @@
     /// the contents of this method with the code editor.
     /// </summary>
-    private void InitializeComponent() {
+    private void InitializeComponent()
+    {
       this.gbAppointment = new System.Windows.Forms.GroupBox();
       this.chbade = new System.Windows.Forms.CheckBox();
@@ -32,7 +37,9 @@
       this.dtpFromTime = new System.Windows.Forms.DateTimePicker();
       this.label6 = new System.Windows.Forms.Label();
-      this.gbRecurrence = new System.Windows.Forms.GroupBox();
-      this.rbtWeekly = new System.Windows.Forms.RadioButton();
-      this.rbtDaily = new System.Windows.Forms.RadioButton();
+      this.txtDays = new System.Windows.Forms.TextBox();
+      this.label4 = new System.Windows.Forms.Label();
+      this.label7 = new System.Windows.Forms.Label();
+      this.btSaveRecurrence = new System.Windows.Forms.Button();
+      this.btCancelRecurrence = new System.Windows.Forms.Button();
       this.gbWeekly = new System.Windows.Forms.GroupBox();
       this.cbSunday = new System.Windows.Forms.CheckBox();
@@ -43,14 +50,6 @@
       this.cbTuesday = new System.Windows.Forms.CheckBox();
       this.cbMonday = new System.Windows.Forms.CheckBox();
-      this.txtDays = new System.Windows.Forms.TextBox();
-      this.label4 = new System.Windows.Forms.Label();
-      this.gbDaily = new System.Windows.Forms.GroupBox();
-      this.label7 = new System.Windows.Forms.Label();
-      this.btSaveRecurrence = new System.Windows.Forms.Button();
-      this.btCancelRecurrence = new System.Windows.Forms.Button();
       this.gbAppointment.SuspendLayout();
-      this.gbRecurrence.SuspendLayout();
       this.gbWeekly.SuspendLayout();
-      this.gbDaily.SuspendLayout();
       this.SuspendLayout();
       // 
@@ -70,5 +69,4 @@
       this.gbAppointment.TabStop = false;
       this.gbAppointment.Text = "Appointment";
-      this.gbAppointment.Enter += new System.EventHandler(this.gbAppointment_Enter);
       // 
       // chbade
@@ -81,5 +79,4 @@
       this.chbade.Text = "All Day Event";
       this.chbade.UseVisualStyleBackColor = true;
-      this.chbade.CheckedChanged += new System.EventHandler(this.chbade_CheckedChanged);
       // 
       // dtpEnd
@@ -93,5 +90,5 @@
       // dtpToTime
       // 
-      this.dtpToTime.CustomFormat = "hh:00";
+      this.dtpToTime.CustomFormat = "HH:00";
       this.dtpToTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
       this.dtpToTime.Location = new System.Drawing.Point(226, 56);
@@ -100,5 +97,4 @@
       this.dtpToTime.Size = new System.Drawing.Size(73, 20);
       this.dtpToTime.TabIndex = 38;
-      this.dtpToTime.ValueChanged += new System.EventHandler(this.dtpToTime_ValueChanged);
       // 
       // label5
@@ -138,160 +134,32 @@
       this.label6.Text = "Start Date:";
       // 
-      // gbRecurrence
-      // 
-      this.gbRecurrence.Controls.Add(this.rbtWeekly);
-      this.gbRecurrence.Controls.Add(this.rbtDaily);
-      this.gbRecurrence.Location = new System.Drawing.Point(2, 117);
-      this.gbRecurrence.Name = "gbRecurrence";
-      this.gbRecurrence.Size = new System.Drawing.Size(123, 94);
-      this.gbRecurrence.TabIndex = 40;
-      this.gbRecurrence.TabStop = false;
-      this.gbRecurrence.Text = "Recurrence Pattern";
-      // 
-      // rbtWeekly
-      // 
-      this.rbtWeekly.AutoSize = true;
-      this.rbtWeekly.Location = new System.Drawing.Point(11, 58);
-      this.rbtWeekly.Name = "rbtWeekly";
-      this.rbtWeekly.Size = new System.Drawing.Size(61, 17);
-      this.rbtWeekly.TabIndex = 1;
-      this.rbtWeekly.Text = "Weekly";
-      this.rbtWeekly.UseVisualStyleBackColor = true;
-      this.rbtWeekly.CheckedChanged += new System.EventHandler(this.rbtDaily_CheckedChanged);
-      // 
-      // rbtDaily
-      // 
-      this.rbtDaily.AutoSize = true;
-      this.rbtDaily.Checked = true;
-      this.rbtDaily.Location = new System.Drawing.Point(11, 34);
-      this.rbtDaily.Name = "rbtDaily";
-      this.rbtDaily.Size = new System.Drawing.Size(48, 17);
-      this.rbtDaily.TabIndex = 0;
-      this.rbtDaily.TabStop = true;
-      this.rbtDaily.Text = "Daily";
-      this.rbtDaily.UseVisualStyleBackColor = true;
-      this.rbtDaily.CheckedChanged += new System.EventHandler(this.rbtDaily_CheckedChanged);
-      // 
-      // gbWeekly
-      // 
-      this.gbWeekly.Controls.Add(this.cbSunday);
-      this.gbWeekly.Controls.Add(this.cbSaturday);
-      this.gbWeekly.Controls.Add(this.cbFriday);
-      this.gbWeekly.Controls.Add(this.cbThursday);
-      this.gbWeekly.Controls.Add(this.cbWednesday);
-      this.gbWeekly.Controls.Add(this.cbTuesday);
-      this.gbWeekly.Controls.Add(this.cbMonday);
-      this.gbWeekly.Location = new System.Drawing.Point(123, 117);
-      this.gbWeekly.Name = "gbWeekly";
-      this.gbWeekly.Size = new System.Drawing.Size(265, 94);
-      this.gbWeekly.TabIndex = 42;
-      this.gbWeekly.TabStop = false;
-      this.gbWeekly.Visible = false;
-      // 
-      // cbSunday
-      // 
-      this.cbSunday.AutoSize = true;
-      this.cbSunday.Location = new System.Drawing.Point(11, 58);
-      this.cbSunday.Name = "cbSunday";
-      this.cbSunday.Size = new System.Drawing.Size(62, 17);
-      this.cbSunday.TabIndex = 6;
-      this.cbSunday.Text = "Sunday";
-      this.cbSunday.UseVisualStyleBackColor = true;
-      // 
-      // cbSaturday
-      // 
-      this.cbSaturday.AutoSize = true;
-      this.cbSaturday.Location = new System.Drawing.Point(173, 37);
-      this.cbSaturday.Name = "cbSaturday";
-      this.cbSaturday.Size = new System.Drawing.Size(68, 17);
-      this.cbSaturday.TabIndex = 5;
-      this.cbSaturday.Text = "Saturday";
-      this.cbSaturday.UseVisualStyleBackColor = true;
-      // 
-      // cbFriday
-      // 
-      this.cbFriday.AutoSize = true;
-      this.cbFriday.Location = new System.Drawing.Point(97, 37);
-      this.cbFriday.Name = "cbFriday";
-      this.cbFriday.Size = new System.Drawing.Size(54, 17);
-      this.cbFriday.TabIndex = 4;
-      this.cbFriday.Text = "Friday";
-      this.cbFriday.UseVisualStyleBackColor = true;
-      // 
-      // cbThursday
-      // 
-      this.cbThursday.AutoSize = true;
-      this.cbThursday.Location = new System.Drawing.Point(11, 37);
-      this.cbThursday.Name = "cbThursday";
-      this.cbThursday.Size = new System.Drawing.Size(70, 17);
-      this.cbThursday.TabIndex = 3;
-      this.cbThursday.Text = "Thursday";
-      this.cbThursday.UseVisualStyleBackColor = true;
-      // 
-      // cbWednesday
-      // 
-      this.cbWednesday.AutoSize = true;
-      this.cbWednesday.Location = new System.Drawing.Point(173, 16);
-      this.cbWednesday.Name = "cbWednesday";
-      this.cbWednesday.Size = new System.Drawing.Size(86, 17);
-      this.cbWednesday.TabIndex = 2;
-      this.cbWednesday.Text = "Wednesday ";
-      this.cbWednesday.UseVisualStyleBackColor = true;
-      // 
-      // cbTuesday
-      // 
-      this.cbTuesday.AutoSize = true;
-      this.cbTuesday.Location = new System.Drawing.Point(97, 16);
-      this.cbTuesday.Name = "cbTuesday";
-      this.cbTuesday.Size = new System.Drawing.Size(67, 17);
-      this.cbTuesday.TabIndex = 1;
-      this.cbTuesday.Text = "Tuesday";
-      this.cbTuesday.UseVisualStyleBackColor = true;
-      // 
-      // cbMonday
-      // 
-      this.cbMonday.AutoSize = true;
-      this.cbMonday.Location = new System.Drawing.Point(11, 16);
-      this.cbMonday.Name = "cbMonday";
-      this.cbMonday.Size = new System.Drawing.Size(64, 17);
-      this.cbMonday.TabIndex = 0;
-      this.cbMonday.Text = "Monday";
-      this.cbMonday.UseVisualStyleBackColor = true;
-      // 
       // txtDays
       // 
-      this.txtDays.Location = new System.Drawing.Point(50, 17);
+      this.txtDays.Location = new System.Drawing.Point(160, 13);
       this.txtDays.Name = "txtDays";
       this.txtDays.Size = new System.Drawing.Size(30, 20);
       this.txtDays.TabIndex = 24;
+      this.txtDays.Text = "1";
+      this.txtDays.Visible = false;
       // 
       // label4
       // 
       this.label4.AutoSize = true;
-      this.label4.Location = new System.Drawing.Point(10, 20);
+      this.label4.Location = new System.Drawing.Point(120, 16);
       this.label4.Name = "label4";
       this.label4.Size = new System.Drawing.Size(34, 13);
       this.label4.TabIndex = 23;
       this.label4.Text = "Every";
-      // 
-      // gbDaily
-      // 
-      this.gbDaily.Controls.Add(this.label7);
-      this.gbDaily.Controls.Add(this.txtDays);
-      this.gbDaily.Controls.Add(this.label4);
-      this.gbDaily.Location = new System.Drawing.Point(123, 117);
-      this.gbDaily.Name = "gbDaily";
-      this.gbDaily.Size = new System.Drawing.Size(265, 94);
-      this.gbDaily.TabIndex = 41;
-      this.gbDaily.TabStop = false;
+      this.label4.Visible = false;
       // 
       // label7
       // 
       this.label7.AutoSize = true;
-      this.label7.Location = new System.Drawing.Point(86, 20);
+      this.label7.Location = new System.Drawing.Point(196, 16);
       this.label7.Name = "label7";
-      this.label7.Size = new System.Drawing.Size(37, 13);
+      this.label7.Size = new System.Drawing.Size(59, 13);
       this.label7.TabIndex = 25;
-      this.label7.Text = "Day(s)";
+      this.label7.Text = "week(s) on";
+      this.label7.Visible = false;
       // 
       // btSaveRecurrence
@@ -303,4 +171,5 @@
       this.btSaveRecurrence.Text = "Save";
       this.btSaveRecurrence.UseVisualStyleBackColor = true;
+      this.btSaveRecurrence.Click += new System.EventHandler(this.btSaveRecurrence_Click);
       // 
       // btCancelRecurrence
@@ -314,4 +183,93 @@
       this.btCancelRecurrence.Click += new System.EventHandler(this.btCancelRecurrence_Click);
       // 
+      // gbWeekly
+      // 
+      this.gbWeekly.Controls.Add(this.label7);
+      this.gbWeekly.Controls.Add(this.cbSunday);
+      this.gbWeekly.Controls.Add(this.txtDays);
+      this.gbWeekly.Controls.Add(this.cbSaturday);
+      this.gbWeekly.Controls.Add(this.cbFriday);
+      this.gbWeekly.Controls.Add(this.cbThursday);
+      this.gbWeekly.Controls.Add(this.label4);
+      this.gbWeekly.Controls.Add(this.cbWednesday);
+      this.gbWeekly.Controls.Add(this.cbTuesday);
+      this.gbWeekly.Controls.Add(this.cbMonday);
+      this.gbWeekly.Location = new System.Drawing.Point(2, 111);
+      this.gbWeekly.Name = "gbWeekly";
+      this.gbWeekly.Size = new System.Drawing.Size(386, 100);
+      this.gbWeekly.TabIndex = 42;
+      this.gbWeekly.TabStop = false;
+      this.gbWeekly.Text = "Days of week";
+      // 
+      // cbSunday
+      // 
+      this.cbSunday.AutoSize = true;
+      this.cbSunday.Location = new System.Drawing.Point(199, 65);
+      this.cbSunday.Name = "cbSunday";
+      this.cbSunday.Size = new System.Drawing.Size(62, 17);
+      this.cbSunday.TabIndex = 6;
+      this.cbSunday.Text = "Sunday";
+      this.cbSunday.UseVisualStyleBackColor = true;
+      // 
+      // cbSaturday
+      // 
+      this.cbSaturday.AutoSize = true;
+      this.cbSaturday.Location = new System.Drawing.Point(122, 65);
+      this.cbSaturday.Name = "cbSaturday";
+      this.cbSaturday.Size = new System.Drawing.Size(68, 17);
+      this.cbSaturday.TabIndex = 5;
+      this.cbSaturday.Text = "Saturday";
+      this.cbSaturday.UseVisualStyleBackColor = true;
+      // 
+      // cbFriday
+      // 
+      this.cbFriday.AutoSize = true;
+      this.cbFriday.Location = new System.Drawing.Point(37, 65);
+      this.cbFriday.Name = "cbFriday";
+      this.cbFriday.Size = new System.Drawing.Size(54, 17);
+      this.cbFriday.TabIndex = 4;
+      this.cbFriday.Text = "Friday";
+      this.cbFriday.UseVisualStyleBackColor = true;
+      // 
+      // cbThursday
+      // 
+      this.cbThursday.AutoSize = true;
+      this.cbThursday.Location = new System.Drawing.Point(289, 40);
+      this.cbThursday.Name = "cbThursday";
+      this.cbThursday.Size = new System.Drawing.Size(70, 17);
+      this.cbThursday.TabIndex = 3;
+      this.cbThursday.Text = "Thursday";
+      this.cbThursday.UseVisualStyleBackColor = true;
+      // 
+      // cbWednesday
+      // 
+      this.cbWednesday.AutoSize = true;
+      this.cbWednesday.Location = new System.Drawing.Point(199, 42);
+      this.cbWednesday.Name = "cbWednesday";
+      this.cbWednesday.Size = new System.Drawing.Size(86, 17);
+      this.cbWednesday.TabIndex = 2;
+      this.cbWednesday.Text = "Wednesday ";
+      this.cbWednesday.UseVisualStyleBackColor = true;
+      // 
+      // cbTuesday
+      // 
+      this.cbTuesday.AutoSize = true;
+      this.cbTuesday.Location = new System.Drawing.Point(123, 42);
+      this.cbTuesday.Name = "cbTuesday";
+      this.cbTuesday.Size = new System.Drawing.Size(67, 17);
+      this.cbTuesday.TabIndex = 1;
+      this.cbTuesday.Text = "Tuesday";
+      this.cbTuesday.UseVisualStyleBackColor = true;
+      // 
+      // cbMonday
+      // 
+      this.cbMonday.AutoSize = true;
+      this.cbMonday.Location = new System.Drawing.Point(37, 42);
+      this.cbMonday.Name = "cbMonday";
+      this.cbMonday.Size = new System.Drawing.Size(64, 17);
+      this.cbMonday.TabIndex = 0;
+      this.cbMonday.Text = "Monday";
+      this.cbMonday.UseVisualStyleBackColor = true;
+      // 
       // Recurrence
       // 
@@ -319,9 +277,7 @@
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       this.ClientSize = new System.Drawing.Size(393, 243);
+      this.Controls.Add(this.gbWeekly);
       this.Controls.Add(this.btCancelRecurrence);
       this.Controls.Add(this.btSaveRecurrence);
-      this.Controls.Add(this.gbWeekly);
-      this.Controls.Add(this.gbDaily);
-      this.Controls.Add(this.gbRecurrence);
       this.Controls.Add(this.gbAppointment);
       this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
@@ -330,10 +286,6 @@
       this.gbAppointment.ResumeLayout(false);
       this.gbAppointment.PerformLayout();
-      this.gbRecurrence.ResumeLayout(false);
-      this.gbRecurrence.PerformLayout();
       this.gbWeekly.ResumeLayout(false);
       this.gbWeekly.PerformLayout();
-      this.gbDaily.ResumeLayout(false);
-      this.gbDaily.PerformLayout();
       this.ResumeLayout(false);
 
@@ -343,10 +295,6 @@
 
     private System.Windows.Forms.GroupBox gbAppointment;
-    private System.Windows.Forms.GroupBox gbRecurrence;
-    private System.Windows.Forms.RadioButton rbtWeekly;
-    private System.Windows.Forms.RadioButton rbtDaily;
     private System.Windows.Forms.TextBox txtDays;
     private System.Windows.Forms.Label label4;
-    private System.Windows.Forms.GroupBox gbDaily;
     private System.Windows.Forms.DateTimePicker dtpEnd;
     private System.Windows.Forms.DateTimePicker dtpStart;
@@ -354,4 +302,9 @@
     private System.Windows.Forms.Label label6;
     private System.Windows.Forms.Label label7;
+    private System.Windows.Forms.Button btSaveRecurrence;
+    private System.Windows.Forms.Button btCancelRecurrence;
+    private System.Windows.Forms.DateTimePicker dtpFromTime;
+    private System.Windows.Forms.DateTimePicker dtpToTime;
+    private System.Windows.Forms.CheckBox chbade;
     private System.Windows.Forms.GroupBox gbWeekly;
     private System.Windows.Forms.CheckBox cbSunday;
@@ -362,9 +315,4 @@
     private System.Windows.Forms.CheckBox cbTuesday;
     private System.Windows.Forms.CheckBox cbMonday;
-    private System.Windows.Forms.Button btSaveRecurrence;
-    private System.Windows.Forms.Button btCancelRecurrence;
-    private System.Windows.Forms.DateTimePicker dtpFromTime;
-    private System.Windows.Forms.DateTimePicker dtpToTime;
-    private System.Windows.Forms.CheckBox chbade;
   }
 }
Index: /trunk/sources/HeuristicLab.Hive.Client.Console/Recurrence.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Console/Recurrence.cs	(revision 1510)
+++ /trunk/sources/HeuristicLab.Hive.Client.Console/Recurrence.cs	(revision 1511)
@@ -1,46 +1,103 @@
 ﻿using System;
 using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
 using System.Windows.Forms;
 
-namespace HeuristicLab.Hive.Client.Console {
-  public partial class Recurrence : Form {
-    public Recurrence() {
+namespace HeuristicLab.Hive.Client.Console
+{
+
+  public enum RecurrenceMode
+  {
+    Daily,
+    Weekly
+  }
+
+  public partial class Recurrence : Form
+  {
+
+    public OnDialogClosedDelegate dialogClosedDelegate;
+
+    public Recurrence()
+    {
       InitializeComponent();
     }
 
-    private void rbtDaily_CheckedChanged(object sender, EventArgs e) {
-      if (rbtDaily.Checked) {
-        gbDaily.Visible = true;
-        gbWeekly.Visible = false;
-      } else if (rbtWeekly.Checked) {
-        gbDaily.Visible = false;
-        gbWeekly.Visible = true;
-      }
-    }
-
-    private void btCancelRecurrence_Click(object sender, EventArgs e) {
+    private void btCancelRecurrence_Click(object sender, EventArgs e)
+    {
       this.Close();
     }
 
-    private void gbAppointment_Enter(object sender, EventArgs e) {
+    private void btSaveRecurrence_Click(object sender, EventArgs e)
+    {
+      DateTime dateFrom, dateTo;
+      RecurrenceMode mode = RecurrenceMode.Daily;
+      int incWeek = 0;
+      HashSet<DayOfWeek> days = new HashSet<DayOfWeek>();
 
+      days = GetDays();
+
+      //check if valid
+      if (InputIsValid())
+      {
+        //set entity
+
+        dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text);
+        dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text);
+
+        if (int.TryParse(txtDays.Text, out incWeek))
+          mode = RecurrenceMode.Weekly;
+        else
+          mode = RecurrenceMode.Daily;
+
+        RecurrentEvent recurrentEvent = new RecurrentEvent()
+        {
+          DateFrom = dateFrom,
+          DateTo = dateTo,
+          AllDay = chbade.Checked,
+          WeekDays = days,
+          IncWeeks = incWeek,
+        };
+
+        //fire delegate and close the dialog
+        dialogClosedDelegate(recurrentEvent);
+        this.Close();
+      }
+      else
+        MessageBox.Show("Incorrect date format", "Schedule Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 
-    private void cmbEnd_Click(object sender, EventArgs e) {
+    private HashSet<DayOfWeek> GetDays()
+    {
+      HashSet<DayOfWeek> days = new HashSet<DayOfWeek>();
 
+      if (cbMonday.Checked)
+        days.Add(DayOfWeek.Monday);
+      if (cbTuesday.Checked)
+        days.Add(DayOfWeek.Tuesday);
+      if (cbWednesday.Checked)
+        days.Add(DayOfWeek.Wednesday);
+      if (cbThursday.Checked)
+        days.Add(DayOfWeek.Thursday);
+      if (cbFriday.Checked)
+        days.Add(DayOfWeek.Friday);
+      if (cbSaturday.Checked)
+        days.Add(DayOfWeek.Saturday);
+      if (cbSunday.Checked)
+        days.Add(DayOfWeek.Sunday);
+
+      return days;
     }
 
-    private void dtpToTime_ValueChanged(object sender, EventArgs e) {
+    private bool InputIsValid()
+    {
+      DateTime dateFrom, dateTo;
+      int i = 0;
 
-    }
+      dateFrom = DateTime.Parse(dtpStart.Text + " " + dtpFromTime.Text);
+      dateTo = DateTime.Parse(dtpEnd.Text + " " + dtpToTime.Text);
 
-    private void chbade_CheckedChanged(object sender, EventArgs e) {
-        dtpFromTime.Visible = !chbade.Checked;
-        dtpToTime.Visible = !chbade.Checked;
+      if (dateFrom < dateTo && dateFrom.TimeOfDay < dateTo.TimeOfDay && int.TryParse(txtDays.Text, out i))
+        return true;
+      else
+        return false;
     }
   }
Index: /trunk/sources/HeuristicLab.Hive.Client.Console/RecurrentEvent.cs
===================================================================
--- /trunk/sources/HeuristicLab.Hive.Client.Console/RecurrentEvent.cs	(revision 1511)
+++ /trunk/sources/HeuristicLab.Hive.Client.Console/RecurrentEvent.cs	(revision 1511)
@@ -0,0 +1,14 @@
+﻿using System;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Hive.Client.Console
+{
+  public class RecurrentEvent
+  {
+    public DateTime DateFrom { get; set; }
+    public DateTime DateTo { get; set; }
+    public bool AllDay { get; set; }
+    public int IncWeeks { get; set; }
+    public HashSet<DayOfWeek> WeekDays { get; set; }
+  }
+}
