Changeset 16211
- Timestamp:
- 10/04/18 12:07:10 (6 years ago)
- Location:
- trunk/HeuristicLab.Clients.Hive.Administrator/3.3/Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectResourcesView.cs
r16202 r16211 30 30 using HeuristicLab.MainForm; 31 31 using System.Collections; 32 using HeuristicLab.Common; 32 33 33 34 namespace HeuristicLab.Clients.Hive.Administrator.Views { … … 72 73 treeView.ImageList.Images.Add(VSImageLibrary.MonitorLarge); 73 74 treeView.ImageList.Images.Add(VSImageLibrary.NetworkCenterLarge); 75 76 HiveAdminClient.Instance.Refreshing += HiveAdminClient_Instance_Refreshing; 77 HiveAdminClient.Instance.Refreshed += HiveAdminClient_Instance_Refreshed; 74 78 } 75 79 76 80 #region Overrides 81 protected override void OnClosing(FormClosingEventArgs e) { 82 HiveAdminClient.Instance.Refreshed -= HiveAdminClient_Instance_Refreshed; 83 HiveAdminClient.Instance.Refreshing -= HiveAdminClient_Instance_Refreshing; 84 base.OnClosing(e); 85 } 86 77 87 protected override void OnContentChanged() { 78 88 base.OnContentChanged(); … … 106 116 107 117 #region Event Handlers 118 private void HiveAdminClient_Instance_Refreshing(object sender, EventArgs e) { 119 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshing, sender, e); 120 else { 121 SetEnabledStateOfControls(); 122 } 123 } 124 125 private void HiveAdminClient_Instance_Refreshed(object sender, EventArgs e) { 126 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshed, sender, e); 127 else { 128 OnContentChanged(); 129 } 130 } 131 108 132 private void ProjectResourcesView_Load(object sender, EventArgs e) { 109 133 … … 385 409 } 386 410 387 411 if (includedResources.Contains(newResource) && newIncludedResources.Contains(newResource)) { 388 412 newNode.Text += INCLUDED_TAG; 389 413 } else if (addedIncludes.Contains(newResource)) { … … 424 448 } 425 449 450 ExpandResourceNodesOfInterest(treeView.Nodes); 451 452 bool expandUngroupedGroupNode = false; 426 453 var ungroupedSlaves = subResources.OfType<Slave>().OrderBy(x => x.Name); 427 454 if(ungroupedSlaves.Any()) { … … 436 463 foreach (var slave in ungroupedSlaves) { 437 464 var slaveNode = new TreeNode(slave.Name) { Tag = slave }; 465 if (newAssignedResources.Contains(slave)) { 466 slaveNode.Checked = true; 467 expandUngroupedGroupNode = true; 468 } 469 470 if (!HiveRoles.CheckAdminUserPermissions()) { 471 slaveNode.ForeColor = SystemColors.GrayText; 472 slaveNode.Text += IMMUTABLE_TAG; 473 } else { 474 if (addedAssignments.Contains(slave)) { 475 slaveNode.BackColor = addedAssignmentColor; 476 slaveNode.ForeColor = SystemColors.ControlText; 477 slaveNode.Text += ADDED_ASSIGNMENT_TAG; 478 } else if (removedAssignments.Contains(slave)) { 479 slaveNode.BackColor = removedAssignmentColor; 480 slaveNode.ForeColor = SystemColors.ControlText; 481 slaveNode.Text += REMOVED_ASSIGNMENT_TAG; 482 expandUngroupedGroupNode = true; 483 } 484 } 438 485 ungroupedGroupNode.Nodes.Add(slaveNode); 439 486 } 487 488 if(expandUngroupedGroupNode) ungroupedGroupNode.Expand(); 440 489 treeView.Nodes.Add(ungroupedGroupNode); 441 490 } else if (ungroupedGroupNode != null) { … … 444 493 445 494 treeView.BeforeCheck += treeView_BeforeCheck; 446 treeView.AfterCheck += treeView_AfterCheck; 447 448 ExpandResourceNodesOfInterest(treeView.Nodes); 495 treeView.AfterCheck += treeView_AfterCheck; 449 496 450 497 return top; -
trunk/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ScheduleView.cs
r16117 r16211 227 227 base.SetEnabledStateOfControls(); 228 228 bool enabled = Content != null && !Locked; 229 dtpFrom.Enabled = enabled; 230 dtpTo.Enabled = enabled; 231 chbade.Enabled = enabled; 229 232 btCreate.Enabled = enabled; 230 btbDelete.Enabled = enabled; 233 btbDelete.Enabled = enabled; 234 btnRecurrence.Enabled = enabled; 231 235 btnClearCal.Enabled = enabled; 232 btnRecurrence.Enabled = enabled;233 236 btnSaveCal.Enabled = enabled; 234 237 }
Note: See TracChangeset
for help on using the changeset viewer.