Changeset 6437 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs
- Timestamp:
- 06/16/11 16:01:39 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs
r6373 r6437 24 24 using System.Linq; 25 25 using System.Windows.Forms; 26 using HeuristicLab.Clients.Hive.Views; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Core.Views; 28 29 using HeuristicLab.MainForm; 29 using HeuristicLab.Clients.Hive.Views;30 30 31 31 namespace HeuristicLab.Clients.Hive.Administration.Views { … … 122 122 if (e.Node.Tag.GetType() == typeof(Slave)) { 123 123 scheduleView.ResourceId = ((Slave)e.Node.Tag).Id; 124 if (tabSlaveGroup.SelectedIndex == 1) { 125 UpdateSchedule(); 126 } 124 127 } else if (e.Node.Tag is SlaveGroup) { 125 128 slaveView.Content.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged); … … 149 152 if (treeSlaveGroup.SelectedNode != null && treeSlaveGroup.SelectedNode.Tag != null) { 150 153 Resource res = (Resource)treeSlaveGroup.SelectedNode.Tag; 151 Content.Remove(res);152 154 153 155 if (res is Slave) { 156 Content.Remove(res); 154 157 ServiceLocator.Instance.CallHiveService(service => service.DeleteSlave(res.Id)); 155 158 } else if (res is SlaveGroup) { 156 159 //only delete empty groups 157 if (Content.Where(s => s.ParentResourceId == res.Id).Count() < 0) { 160 if (Content.Where(s => s.ParentResourceId == res.Id).Count() < 1) { 161 Content.Remove(res); 158 162 ServiceLocator.Instance.CallHiveService(service => service.DeleteSlaveGroup(res.Id)); 159 163 } else { 160 MessageBox.Show("Only empty groups can be deleted." );164 MessageBox.Show("Only empty groups can be deleted.", "HeuristicLab Hive Administration", MessageBoxButtons.OK, MessageBoxIcon.Error); 161 165 } 162 166 } … … 168 172 if (res is SlaveGroup && res.Id == Guid.Empty) { 169 173 SlaveGroup slaveGroup = (SlaveGroup)res; 170 ServiceLocator.Instance.CallHiveService(service => s ervice.AddSlaveGroup(slaveGroup));174 ServiceLocator.Instance.CallHiveService(service => slaveGroup.Id = service.AddSlaveGroup(slaveGroup)); 171 175 } 172 176 if (res.Id != Guid.Empty && res.Modified) { … … 198 202 if (newNode.Tag != null && newNode.Tag is Slave) { 199 203 Slave slave = (Slave)newNode.Tag; 200 if (slave.ParentResourceId != sgrp.Id) { 204 205 if (sgrp.Id == Guid.Empty) { 206 ServiceLocator.Instance.CallHiveService(service => sgrp.Id = service.AddSlaveGroup(sgrp)); 207 } 208 209 if (slave.ParentResourceId == null || (slave.ParentResourceId != null && slave.ParentResourceId != sgrp.Id)) { 201 210 slave.ParentResourceId = sgrp.Id; 202 211 OnContentChanged(); … … 257 266 } 258 267 } 268 269 private void tabSlaveGroup_SelectedIndexChanged(object sender, EventArgs e) { 270 if (tabSlaveGroup.SelectedIndex == 1) { 271 UpdateSchedule(); 272 } 273 } 259 274 } 260 275 }
Note: See TracChangeset
for help on using the changeset viewer.