- Timestamp:
- 09/11/11 21:54:39 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3/HiveAdministratorClient.cs
r6688 r6734 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using HeuristicLab.Common; 24 23 using HeuristicLab.Core; … … 27 26 [Item("Hive Administrator", "Hive Administrator")] 28 27 public class HiveAdministratorClient : Item { 29 public List<SlaveGroup> SlaveGroups;30 public List<Slave> Slaves;31 32 28 33 29 public HiveAdministratorClient() { 34 UpdateSlaveGroups();35 30 } 36 31 … … 42 37 return new HiveAdministratorClient(this, cloner); 43 38 } 44 45 public void UpdateSlaveGroups() {46 ServiceLocator.Instance.CallHiveService(service => {47 SlaveGroups = new List<SlaveGroup>(service.GetSlaveGroups());48 Slaves = new List<Slave>(service.GetSlaves());49 });50 }51 39 } 52 40 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3/Views/Common/UpdateControl.cs
r6721 r6734 32 32 public Action UpdateAction { get; set; } 33 33 34 public void Update() { 35 btnRefresh_Click(this, null); 36 } 37 34 38 private void PrivUpdateAction() { 35 39 UpdateAction(); 36 imgBoxProgress.Invoke(new MethodInvoker(() => imgBoxProgress.Visible = false)); 40 if (imgBoxProgress.InvokeRequired) { 41 imgBoxProgress.Invoke(new MethodInvoker(() => imgBoxProgress.Visible = false)); 42 } else { 43 imgBoxProgress.Visible = false; 44 } 37 45 } 38 46 39 47 private void btnRefresh_Click(object sender, EventArgs e) { 40 48 if (UpdateAction != null) { 41 imgBoxProgress.Visible = true; 49 if (imgBoxProgress.InvokeRequired) { 50 imgBoxProgress.Invoke(new MethodInvoker(() => imgBoxProgress.Visible = true)); 51 } else { 52 imgBoxProgress.Visible = true; 53 } 54 42 55 Action action = new Action(PrivUpdateAction); 43 56 TS.Task task = new TS.Task(action); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3/Views/HiveAdministratorView.Designer.cs
r6688 r6734 85 85 this.Name = "HiveAdministrationView"; 86 86 this.Size = new System.Drawing.Size(745, 546); 87 this.Load += new System.EventHandler(this.HiveAdministrationView_Load);88 87 this.tabAdmin.ResumeLayout(false); 89 88 this.tabSlaves.ResumeLayout(false); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3/Views/HiveAdministratorView.cs
r6688 r6734 21 21 22 22 using System.Windows.Forms; 23 using HeuristicLab.Core;24 23 using HeuristicLab.Core.Views; 25 24 using HeuristicLab.MainForm; … … 40 39 #region Register Content Events 41 40 protected override void DeregisterContentEvents() { 42 // TODO: Deregister your event handlers on the Content here43 41 base.DeregisterContentEvents(); 44 42 } 45 43 protected override void RegisterContentEvents() { 46 44 base.RegisterContentEvents(); 47 // TODO: Register your event handlers on the Content here48 45 } 49 46 #endregion 50 47 51 private void UpdateResources() {52 IItemList<Resource> resources = new ItemList<Resource>();53 54 foreach (SlaveGroup g in Content.SlaveGroups) {55 resources.Add(g);56 }57 foreach (Slave g in Content.Slaves) {58 resources.Add(g);59 }60 resourcesView.Content = resources;61 }62 63 48 protected override void OnContentChanged() { 64 49 base.OnContentChanged(); 65 if (Content == null) {66 resourcesView.Content = null;67 68 } else {69 //updateSlaveGroups.UpdateAction = new Action(Content.UpdateSlaveGroups); //??70 UpdateResources();71 }72 50 } 73 51 74 52 protected override void SetEnabledStateOfControls() { 75 53 base.SetEnabledStateOfControls(); 76 // TODO: Put code here to enable or disable controls based on whether the Content is/not null or the view is ReadOnly77 54 } 78 79 private void HiveAdministrationView_Load(object sender, System.EventArgs e) {80 if (Content != null) {81 82 }83 }84 85 #region Event Handlers86 // TODO: Put event handlers here87 #endregion88 55 } 89 56 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs
r6688 r6734 49 49 updateScheduleControl.UpdateAction = new Action(UpdateSchedule); 50 50 updateSlaveGroup.UpdateAction = new Action(UpdateSlaveGroups); 51 } 51 52 updateSlaveGroup.Update(); 53 } 54 52 55 53 56 #region Register Content Events … … 131 134 protected override void SetEnabledStateOfControls() { 132 135 base.SetEnabledStateOfControls(); 133 // TODO: Put code here to enable or disable controls based on whether the Content is/not null or the view is ReadOnly134 136 } 135 137 … … 293 295 void ResetView() { 294 296 treeSlaveGroup.Nodes.Clear(); 297 295 298 if (slaveView.Content != null && slaveView.Content is SlaveGroup) { 296 299 slaveView.Content.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(SlaveViewContent_PropertyChanged); … … 301 304 302 305 private void UpdateSlaveGroups() { 303 this.Invoke(new Action(ResetView)); 304 Content.Clear(); 306 if (this.InvokeRequired) { 307 this.Invoke(new Action(ResetView)); 308 } else { 309 ResetView(); 310 } 311 305 312 IItemList<Resource> resources = new ItemList<Resource>(); 306 313
Note: See TracChangeset
for help on using the changeset viewer.