Index: branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerConsole.Designer.cs
===================================================================
--- branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerConsole.Designer.cs	(revision 1273)
+++ branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerConsole.Designer.cs	(revision 1372)
@@ -45,8 +45,5 @@
     /// </summary>
     private void InitializeComponent() {
-      this.msServerConsole = new System.Windows.Forms.MenuStrip();
-      this.tsmiConsole = new System.Windows.Forms.ToolStripMenuItem();
-      this.tsmiExit = new System.Windows.Forms.ToolStripMenuItem();
-      this.gbManager = new System.Windows.Forms.GroupBox();
+      this.gbConfiguration = new System.Windows.Forms.GroupBox();
       this.lblPort = new System.Windows.Forms.Label();
       this.lblIp = new System.Windows.Forms.Label();
@@ -54,5 +51,5 @@
       this.tbIp = new System.Windows.Forms.TextBox();
       this.btnLogin = new System.Windows.Forms.Button();
-      this.groupBox1 = new System.Windows.Forms.GroupBox();
+      this.gpUser = new System.Windows.Forms.GroupBox();
       this.tbUserName = new System.Windows.Forms.TextBox();
       this.lblPwd = new System.Windows.Forms.Label();
@@ -60,46 +57,20 @@
       this.tbPwd = new System.Windows.Forms.TextBox();
       this.lblError = new System.Windows.Forms.Label();
-      this.msServerConsole.SuspendLayout();
-      this.gbManager.SuspendLayout();
-      this.groupBox1.SuspendLayout();
+      this.gbConfiguration.SuspendLayout();
+      this.gpUser.SuspendLayout();
       this.SuspendLayout();
       // 
-      // msServerConsole
-      // 
-      this.msServerConsole.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.tsmiConsole});
-      this.msServerConsole.Location = new System.Drawing.Point(0, 0);
-      this.msServerConsole.Name = "msServerConsole";
-      this.msServerConsole.Size = new System.Drawing.Size(311, 24);
-      this.msServerConsole.TabIndex = 0;
-      this.msServerConsole.Text = "menuStrip1";
-      // 
-      // tsmiConsole
-      // 
-      this.tsmiConsole.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.tsmiExit});
-      this.tsmiConsole.Name = "tsmiConsole";
-      this.tsmiConsole.Size = new System.Drawing.Size(87, 20);
-      this.tsmiConsole.Text = "Serverconsole";
-      // 
-      // tsmiExit
-      // 
-      this.tsmiExit.Name = "tsmiExit";
-      this.tsmiExit.Size = new System.Drawing.Size(103, 22);
-      this.tsmiExit.Text = "Exit";
-      this.tsmiExit.Click += new System.EventHandler(this.tsmiExit_Click);
-      // 
-      // gbManager
-      // 
-      this.gbManager.Controls.Add(this.lblPort);
-      this.gbManager.Controls.Add(this.lblIp);
-      this.gbManager.Controls.Add(this.tbPort);
-      this.gbManager.Controls.Add(this.tbIp);
-      this.gbManager.Location = new System.Drawing.Point(16, 124);
-      this.gbManager.Name = "gbManager";
-      this.gbManager.Size = new System.Drawing.Size(283, 82);
-      this.gbManager.TabIndex = 4;
-      this.gbManager.TabStop = false;
-      this.gbManager.Text = "Manager";
+      // gbConfiguration
+      // 
+      this.gbConfiguration.Controls.Add(this.lblPort);
+      this.gbConfiguration.Controls.Add(this.lblIp);
+      this.gbConfiguration.Controls.Add(this.tbPort);
+      this.gbConfiguration.Controls.Add(this.tbIp);
+      this.gbConfiguration.Location = new System.Drawing.Point(12, 100);
+      this.gbConfiguration.Name = "gbConfiguration";
+      this.gbConfiguration.Size = new System.Drawing.Size(283, 82);
+      this.gbConfiguration.TabIndex = 4;
+      this.gbConfiguration.TabStop = false;
+      this.gbConfiguration.Text = "Configuration";
       // 
       // lblPort
@@ -139,5 +110,5 @@
       // btnLogin
       // 
-      this.btnLogin.Location = new System.Drawing.Point(183, 212);
+      this.btnLogin.Location = new System.Drawing.Point(179, 188);
       this.btnLogin.Name = "btnLogin";
       this.btnLogin.Size = new System.Drawing.Size(116, 23);
@@ -148,16 +119,16 @@
       this.btnLogin.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress);
       // 
-      // groupBox1
-      // 
-      this.groupBox1.Controls.Add(this.tbUserName);
-      this.groupBox1.Controls.Add(this.lblPwd);
-      this.groupBox1.Controls.Add(this.lblUsername);
-      this.groupBox1.Controls.Add(this.tbPwd);
-      this.groupBox1.Location = new System.Drawing.Point(16, 36);
-      this.groupBox1.Name = "groupBox1";
-      this.groupBox1.Size = new System.Drawing.Size(283, 82);
-      this.groupBox1.TabIndex = 1;
-      this.groupBox1.TabStop = false;
-      this.groupBox1.Text = "Manager";
+      // gpUser
+      // 
+      this.gpUser.Controls.Add(this.tbUserName);
+      this.gpUser.Controls.Add(this.lblPwd);
+      this.gpUser.Controls.Add(this.lblUsername);
+      this.gpUser.Controls.Add(this.tbPwd);
+      this.gpUser.Location = new System.Drawing.Point(12, 12);
+      this.gpUser.Name = "gpUser";
+      this.gpUser.Size = new System.Drawing.Size(283, 82);
+      this.gpUser.TabIndex = 1;
+      this.gpUser.TabStop = false;
+      this.gpUser.Text = "User";
       // 
       // tbUserName
@@ -209,20 +180,16 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.ClientSize = new System.Drawing.Size(311, 263);
+      this.ClientSize = new System.Drawing.Size(311, 225);
       this.Controls.Add(this.lblError);
-      this.Controls.Add(this.groupBox1);
+      this.Controls.Add(this.gpUser);
       this.Controls.Add(this.btnLogin);
-      this.Controls.Add(this.gbManager);
-      this.Controls.Add(this.msServerConsole);
-      this.MainMenuStrip = this.msServerConsole;
+      this.Controls.Add(this.gbConfiguration);
       this.Name = "HiveServerConsole";
       this.Text = "Server Console";
       this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress);
-      this.msServerConsole.ResumeLayout(false);
-      this.msServerConsole.PerformLayout();
-      this.gbManager.ResumeLayout(false);
-      this.gbManager.PerformLayout();
-      this.groupBox1.ResumeLayout(false);
-      this.groupBox1.PerformLayout();
+      this.gbConfiguration.ResumeLayout(false);
+      this.gbConfiguration.PerformLayout();
+      this.gpUser.ResumeLayout(false);
+      this.gpUser.PerformLayout();
       this.ResumeLayout(false);
       this.PerformLayout();
@@ -232,8 +199,5 @@
     #endregion
 
-    private System.Windows.Forms.MenuStrip msServerConsole;
-    private System.Windows.Forms.ToolStripMenuItem tsmiConsole;
-    private System.Windows.Forms.ToolStripMenuItem tsmiExit;
-    private System.Windows.Forms.GroupBox gbManager;
+    private System.Windows.Forms.GroupBox gbConfiguration;
     private System.Windows.Forms.Label lblPort;
     private System.Windows.Forms.Label lblIp;
@@ -241,5 +205,5 @@
     private System.Windows.Forms.TextBox tbIp;
     private System.Windows.Forms.Button btnLogin;
-    private System.Windows.Forms.GroupBox groupBox1;
+    private System.Windows.Forms.GroupBox gpUser;
     private System.Windows.Forms.TextBox tbUserName;
     private System.Windows.Forms.Label lblPwd;
Index: branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerConsole.resx
===================================================================
--- branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerConsole.resx	(revision 1273)
+++ branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerConsole.resx	(revision 1372)
@@ -118,6 +118,3 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="msServerConsole.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
 </root>
Index: branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs
===================================================================
--- branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs	(revision 1273)
+++ branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs	(revision 1372)
@@ -63,4 +63,6 @@
     private bool flagUser = false;
 
+    private List<Changes> changes = new List<Changes>();
+
     private ToolTip tt = new ToolTip();
     #endregion
@@ -80,6 +82,8 @@
     /// <param name="e"></param>
     private void TickSync(object obj, EventArgs e) {
-      Refresh();
-      //updaterWoker.RunWorkerAsync();
+      //Refresh();
+      if (!updaterWoker.IsBusy) {
+        updaterWoker.RunWorkerAsync();
+      }
     }
 
@@ -375,5 +379,5 @@
       AddJobForm newForm = new AddJobForm();
       newForm.Show();
-      newForm.addJobEvent += new addDelegate(Refresh);
+      //newForm.addJobEvent += new addDelegate(updaterWoker.RunWorkerAsync);
     }
 
@@ -481,17 +485,88 @@
 
     private void updaterWoker_DoWork(object sender, DoWorkEventArgs e) {
-      #region ClientInfo
-      List<Changes> changes = new List<Changes>();
-      ResponseList<ClientInfo> clientInfoOld = clientInfo;
+
       IClientManager clientManager =
           ServiceLocator.GetClientManager();
+      
+      #region ClientInfo
+      ResponseList<ClientInfo> clientInfoOld = clientInfo;
+      clientInfo = clientManager.GetAllClients();
+
+      ResponseList<ClientInfo> clientInfoOldHelp;
+
+      CloneList(clientInfoOld, out clientInfoOldHelp);
+
+      GetDelta(clientInfoOld.List, clientInfoOldHelp.List);
+      #endregion
+
+      #region Clients
+      ResponseList<ClientGroup> clientsOld = clients;
+     
+      clients = clientManager.GetAllClientGroups();
+
+      ResponseList<ClientGroup> clientsOldHelp;
+
+      CloneList(clientsOld, out clientsOldHelp);
+
+      GetDelta(clientsOld.List, clientsOldHelp.List);
+      #endregion
+
+      #region Job
+      ResponseList<Job> jobsOld = jobs;
+      IJobManager jobManager =
+          ServiceLocator.GetJobManager();
+
+      jobs = jobManager.GetAllJobs();
+
+      ResponseList<Job> jobsOldHelp = new ResponseList<Job>();
+      CloneList(jobsOld, out jobsOldHelp);
+      
+      //System.Diagnostics.Debug.WriteLine(jobsOldHelp.List[0].Id.ToString());
+
+      GetDelta(jobsOld.List, jobsOldHelp.List);
+
+      #endregion
+
+    }
+    #endregion
+
+    #region Helper methods
+
+    private void CloneList(ResponseList<Job> oldList, out ResponseList<Job> newList) {
+      newList = new ResponseList<Job>();
+      newList.List = new List<Job>();
+      foreach (Job item in oldList.List) {
+        newList.List.Add(item);
+      }
+    }
+
+    private void CloneList(ResponseList<ClientInfo> oldList, out ResponseList<ClientInfo> newList) {
+      newList = new ResponseList<ClientInfo>();
+      newList.List = new List<ClientInfo>();
+      foreach (ClientInfo item in oldList.List) {
+        newList.List.Add(item);
+      }
+    }
+
+    private void CloneList(ResponseList<ClientGroup> oldList, out ResponseList<ClientGroup> newList) {
+      newList = new ResponseList<ClientGroup>();
+      newList.List = new List<ClientGroup>();
+      foreach (ClientGroup item in oldList.List) {
+        newList.List.Add(item);
+      }
+    }
+
+    private bool IsEqual(ClientInfo ci1, ClientInfo ci2) {
+      if (ci1.ClientId.Equals(ci2.ClientId)) {
+        return true;
+      } else return false;
+    }
+
+    private void GetDelta(IList<ClientInfo> oldClient, IList<ClientInfo> helpClients) {
       bool found = false;
-      clientInfo = clientManager.GetAllClients();
-
-      ResponseList<ClientInfo> clientInfoOldHelp = clientInfoOld;
 
       foreach (ClientInfo ci in clientInfo.List) {
-        for (int i = 0; i < clientInfoOld.List.Count; i ++) {
-          ClientInfo cio = clientInfoOld.List[i];
+        for (int i = 0; i < oldClient.Count; i++) {
+          ClientInfo cio = oldClient[i];
           if (ci.Id.Equals(cio.Id)) {
             found = true;
@@ -499,10 +574,10 @@
               changes.Add(new Changes { Types = Type.Client, ID = ci.Id, ChangeType = Change.Update });
             }
-              for (int j = 0; j < clientInfoOldHelp.List.Count; j++) {
-                if (cio.Id.Equals(clientInfoOldHelp.List[i])) {
-                  clientInfoOldHelp.List.RemoveAt(i);
-                  break;
-                }
-              } 
+            for (int j = 0; j < helpClients.Count; j++) {
+              if (cio.Id.Equals(helpClients[j])) {
+                helpClients.RemoveAt(j);
+                break;
+              }
+            }
             break;
           }
@@ -511,20 +586,18 @@
           changes.Add(new Changes { Types = Type.Client, ID = ci.Id, ChangeType = Change.Create });
         }
-      }
-      foreach (ClientInfo ci in clientInfoOldHelp.List) {
+        found = false;
+      }
+      foreach (ClientInfo ci in helpClients) {
         changes.Add(new Changes { Types = Type.Client, ID = ci.Id, ChangeType = Change.Delete });
       }
-      #endregion
-
-      #region Clients
-      ResponseList<ClientGroup> clientsOld = clients;
-      found = false;
-      clients = clientManager.GetAllClientGroups();
-
-      ResponseList<ClientGroup> clientsOldHelp = clientsOld;
-
+
+    }
+
+    private void GetDelta(IList<ClientGroup> oldClient, IList<ClientGroup> helpClients) {
+
+      bool found = false;
       foreach (ClientGroup cg in clients.List) {
-        for (int i = 0; i < clientInfoOld.List.Count; i++) {
-          ClientGroup cgo = clientsOld.List[i];
+        for (int i = 0; i < oldClient.Count; i++) {
+          ClientGroup cgo = oldClient[i];
           if (cg.Id.Equals(cgo.Id)) {
             found = true;
@@ -538,7 +611,7 @@
               }
             }
-            for (int j = 0; j < clientInfoOldHelp.List.Count; j++) {
-              if (cgo.Id.Equals(clientInfoOldHelp.List[i])) {
-                clientInfoOldHelp.List.RemoveAt(i);
+            for (int j = 0; j < helpClients.Count; j++) {
+              if (cgo.Id.Equals(helpClients[j])) {
+                helpClients.RemoveAt(j);
                 break;
               }
@@ -550,49 +623,54 @@
           changes.Add(new Changes { Types = Type.ClientGroup, ID = cg.Id, ChangeType = Change.Create });
         }
-      }
-      foreach (ClientGroup cg in clientsOldHelp.List) {
+        found = false;
+      }
+      foreach (ClientGroup cg in helpClients) {
         changes.Add(new Changes { Types = Type.ClientGroup, ID = cg.Id, ChangeType = Change.Delete });
       }
-      #endregion
-
-      #region job
-      ResponseList<Job> jobsOld = jobs;
-      IJobManager jobManager =
-          ServiceLocator.GetJobManager();
-      found = false;
-      jobs = jobManager.GetAllJobs();
-
-      ResponseList<Job> jobsOldHelp = jobsOld;
-
+    }
+     
+    private void GetDelta(IList<Job> oldJobs, IList<Job> helpJobs) {
+      bool found = false;
       foreach (Job job in jobs.List) {
-        for (int i = 0; i < jobsOld.List.Count; i++) {
-          Job jobold = jobsOld.List[i];
+        
+        for (int i = 0; i < oldJobs.Count; i++) {
+          
+          Job jobold = oldJobs[i];
+
           if (job.Id.Equals(jobold.Id)) {
+
             found = true;
-            if (job.Client != jobold.Client) {
+            if (IsEqual(job.Client, jobold.Client)) {
               changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Update });
             } else if (job.DateCalculated != jobold.DateCalculated) {
               changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Update });
             }
-            //for (int j = 0; j < clientInfoOldHelp.List.Count; j++) {
-            //  if (job.Id.Equals(clientInfoOldHelp.List[i])) {
-            //    clientInfoOldHelp.List.RemoveAt(i);
-            //    break;
-            //  }
-            //}
+
+            for (int j = 0; j < helpJobs.Count; j++) {
+              if (job.Id.Equals(helpJobs[j].Id)) {
+                helpJobs.RemoveAt(j);
+                break;
+              }
+            }
             break;
           }
+
         }
         if (found == false) {
           changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Create });
-        }
-      }
-      foreach (Job job in jobsOldHelp.List) {
+          System.Diagnostics.Debug.WriteLine("new Job: " + job.Id);
+        }
+        found = false;
+      }
+      foreach (Job job in helpJobs) {
         changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Delete });
-      }
-      #endregion
-
-    }
+        System.Diagnostics.Debug.WriteLine("delete Job: " + job.Id);
+      }
+    }
+
+
     #endregion
+
+
   }
 }
