Index: /branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs
===================================================================
--- /branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs	(revision 16063)
+++ /branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs	(revision 16064)
@@ -212,5 +212,5 @@
     private void btnAddGroup_Click(object sender, EventArgs e) {
       Guid? parentResourceId = null;
-      if(!IsAdmin()) {
+      if (!IsAdmin()) {
         MessageBox.Show(
           "You have no permission to add a resource group.",
@@ -219,5 +219,5 @@
           MessageBoxIcon.Information);
         return;
-      } else if(selectedResource != null && selectedResource.Id == Guid.Empty) {
+      } else if (selectedResource != null && selectedResource.Id == Guid.Empty) {
         MessageBox.Show(
           "You cannot add a resource group to a not yet stored group.",
@@ -227,5 +227,5 @@
         return;
       }
-      
+
       if (selectedResource != null && selectedResource is SlaveGroup) parentResourceId = selectedResource.Id;
       var group = new SlaveGroup {
@@ -276,8 +276,8 @@
             RemoveResource(selectedResource);
           },
-          finallyCallback: () => { 
+          finallyCallback: () => {
             btnRemoveGroup.Enabled = true;
           });
-      } 
+      }
     }
 
@@ -304,5 +304,5 @@
       if (node == null || node == ungroupedGroupNode) return;
       var r = (Resource)node.Tag;
-      if(!HiveAdminClient.Instance.DisabledParentResources.Contains(r)) ChangeSelectedResourceNode(node);
+      if (!HiveAdminClient.Instance.DisabledParentResources.Contains(r)) ChangeSelectedResourceNode(node);
     }
 
@@ -312,9 +312,9 @@
 
     private void treeSlaveGroup_BeforeCheck(object sender, TreeViewCancelEventArgs e) {
-      if(e.Node == ungroupedGroupNode) {
+      if (e.Node == ungroupedGroupNode) {
         e.Cancel = true;
       } else {
         var r = (Resource)e.Node.Tag;
-        if(HiveAdminClient.Instance.DisabledParentResources.Contains(r)) {
+        if (HiveAdminClient.Instance.DisabledParentResources.Contains(r)) {
           e.Cancel = true;
         }
@@ -329,5 +329,5 @@
       var resources = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IEnumerable<Resource>;
 
-      foreach(var r in resources) {
+      foreach (var r in resources) {
         r.ParentResourceId = targetResource?.Id;
       }
@@ -343,14 +343,14 @@
       var nodes = GetCheckedNodes(treeView.Nodes).ToList();
       TreeNode sourceNode = (TreeNode)e.Item;
-      if(!sourceNode.Checked) nodes.Add(sourceNode);
+      if (!sourceNode.Checked) nodes.Add(sourceNode);
       nodes.Remove(ungroupedGroupNode);
       ungroupedGroupNode.Checked = false;
       var resources = nodes.Select(x => x.Tag).OfType<Resource>().ToList();
 
-      if(resources.Count > 0) {
+      if (resources.Count > 0) {
         DataObject data = new DataObject();
         data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, resources);
         var action = DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link | DragDropEffects.Move);
-        if(action.HasFlag(DragDropEffects.Move)) {
+        if (action.HasFlag(DragDropEffects.Move)) {
           foreach (var node in nodes) node.Remove();
           StyleTreeNode(ungroupedGroupNode, (Resource)ungroupedGroupNode.Tag, resources);
@@ -363,7 +363,7 @@
         foreach (var node in nodes.OfType<TreeNode>()) {
           if (node.Checked && node != ungroupedGroupNode) yield return node;
-            foreach (var child in GetCheckedNodes(node.Nodes))
-              yield return child;
-          }
+          foreach (var child in GetCheckedNodes(node.Nodes))
+            yield return child;
+        }
       }
     }
@@ -375,5 +375,5 @@
       var targetResource = targetNode?.Tag as Resource;
 
-      if(!IsAdmin() 
+      if (!IsAdmin()
         || resources == null
         || !resources.Any()
@@ -389,5 +389,5 @@
 
     private async void TabSlaveGroup_Selected(object sender, System.Windows.Forms.TabControlEventArgs e) {
-      if(e.TabPage == tabSchedule) {
+      if (e.TabPage == tabSchedule) {
         await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions(
           action: () => UpdateSchedule(),
@@ -435,5 +435,5 @@
         }
 
-        if(disabledParentResources.Contains(newResource)) {
+        if (disabledParentResources.Contains(newResource)) {
           newNode.Checked = false;
           newNode.ForeColor = grayTextColor;
@@ -469,8 +469,8 @@
 
       // collapse slave-only nodes
-      foreach(TreeNode n in treeView.Nodes) {
+      foreach (TreeNode n in treeView.Nodes) {
         CollapseSlaveOnlyNodes(n);
       }
-      
+
       ungroupedGroupNode = new TreeNode(UNGROUPED_GROUP_NAME) {
         ForeColor = SystemColors.GrayText,
@@ -501,5 +501,5 @@
         ungroupedGroupNode.Expand();
       }
-      treeView.Nodes.Add(ungroupedGroupNode);      
+      treeView.Nodes.Add(ungroupedGroupNode);
     }
 
@@ -507,6 +507,6 @@
       Resource r = (Resource)tn.Tag;
       var descendants = GetResourceDescendants();
-      if(descendants.ContainsKey(r.Id)) {
-        if(descendants[r.Id].OfType<SlaveGroup>().Any()) {
+      if (descendants.ContainsKey(r.Id)) {
+        if (descendants[r.Id].OfType<SlaveGroup>().Any()) {
           tn.Expand();
           foreach (TreeNode n in tn.Nodes) CollapseSlaveOnlyNodes(n);
@@ -546,5 +546,5 @@
         HiveAdminClient.Instance.Refresh();
         Content = HiveAdminClient.Instance.Resources;
-      } catch(AnonymousUserException) {
+      } catch (AnonymousUserException) {
         ShowHiveInformationDialog();
       }
@@ -564,5 +564,5 @@
           Content.Remove(selectedResource);
         }
-      } catch(AnonymousUserException) {
+      } catch (AnonymousUserException) {
         ShowHiveInformationDialog();
       }
@@ -586,5 +586,5 @@
       n.ForeColor = Color.Black;
 
-      if(HiveAdminClient.Instance.DisabledParentResources.Select(x => x.Id).Contains(r.Id)) {
+      if (HiveAdminClient.Instance.DisabledParentResources.Select(x => x.Id).Contains(r.Id)) {
         n.ForeColor = grayTextColor;
       } else if (r.Id == Guid.Empty && n != ungroupedGroupNode /*!r.Name.StartsWith(UNGROUPED_GROUP_NAME)*/) {
@@ -607,8 +607,8 @@
             .Count();
         }
-      } else if(n == ungroupedGroupNode /*|| r.Name.StartsWith(UNGROUPED_GROUP_NAME)*/) {
+      } else if (n == ungroupedGroupNode /*|| r.Name.StartsWith(UNGROUPED_GROUP_NAME)*/) {
         childSlavesCount = resources
           .OfType<Slave>()
-          .Where(x => x.ParentResourceId == null 
+          .Where(x => x.ParentResourceId == null
             || (x.ParentResourceId.HasValue && x.ParentResourceId.Value == Guid.Empty))
           .Count();
@@ -634,6 +634,6 @@
 
       // ungrouped
-      if(n == ungroupedGroupNode /*r.Name.StartsWith(UNGROUPED_GROUP_NAME)*/) {
-        n.ForeColor = ForeColor = SystemColors.GrayText;
+      if (n == ungroupedGroupNode /*r.Name.StartsWith(UNGROUPED_GROUP_NAME)*/) {
+        n.ForeColor = SystemColors.GrayText;
       }
     }
@@ -704,9 +704,9 @@
 
       foreach (var r in resources) resourceDescendants.Add(r.Id, new HashSet<Resource>());
-      foreach(var r in resources) {
+      foreach (var r in resources) {
         var parentResourceId = r.ParentResourceId;
-        while(parentResourceId != null) {
+        while (parentResourceId != null) {
           var parent = resources.SingleOrDefault(x => x.Id == parentResourceId);
-          if(parent != null) {
+          if (parent != null) {
             resourceDescendants[parent.Id].Add(r);
             parentResourceId = parent.ParentResourceId;
@@ -718,5 +718,5 @@
       return resourceDescendants;
     }
-    
+
     #endregion
   }
