- Timestamp:
- 03/16/11 14:12:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/Administration/ResourcesView.cs
r5676 r5711 145 145 146 146 private void btnRemoveGroup_Click(object sender, EventArgs e) { 147 //TODO: display some warning? 147 148 if (treeSlaveGroup.SelectedNode != null && treeSlaveGroup.SelectedNode.Tag != null) { 148 Content.Remove((Resource)treeSlaveGroup.SelectedNode.Tag); 149 Resource res = (Resource)treeSlaveGroup.SelectedNode.Tag; 150 Content.Remove(res); 151 152 if (res is Slave) { 153 ServiceLocator.Instance.CallHiveService(service => service.DeleteSlave(res.Id)); 154 } else if (res is SlaveGroup) { 155 //only delete empty groups 156 if (Content.Where(s => s.ParentResourceId == res.Id).Count() < 0) { 157 ServiceLocator.Instance.CallHiveService(service => service.DeleteSlaveGroup(res.Id)); 158 } else { 159 MessageBox.Show("Only empty groups can be deleted."); 160 } 161 } 149 162 } 150 163 }
Note: See TracChangeset
for help on using the changeset viewer.