- Timestamp:
- 03/05/09 17:56:06 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs
r1174 r1261 47 47 private ResponseList<User> usersList = null; 48 48 49 private Dictionary<long, ListViewGroup> clientObjects; 50 private Dictionary<long, ListViewItem> clientInfoObjects; 51 private Dictionary<long, ListViewItem> jobObjects; 52 private Dictionary<long, ListViewGroup> userGroupsObjects; 53 private Dictionary<long, ListViewItem> userListObjects; 54 49 55 private Job currentJob = null; 50 56 private ClientInfo currentClient = null; … … 73 79 /// <param name="obj"></param> 74 80 /// <param name="e"></param> 75 private void TickSync(object obj, EventArgs e) { 76 Refresh();81 private void TickSync(object obj, EventArgs e) { 82 updaterWoker.RunWorkerAsync(); 77 83 } 78 84 … … 82 88 private void AddClients() { 83 89 try { 90 clientObjects = new Dictionary<long, ListViewGroup>(); 91 clientInfoObjects = new Dictionary<long, ListViewItem>(); 84 92 IClientManager clientManager = 85 93 ServiceLocator.GetClientManager(); 86 94 87 95 clients = clientManager.GetAllClientGroups(); 88 89 96 lvClientControl.Items.Clear(); 90 97 tvClientControl.Nodes.Clear(); … … 95 102 foreach (ClientInfo ci in clientManager.GetAllClients().List) { 96 103 tvClientControl.Nodes[tvClientControl.Nodes.Count - 1].Nodes.Add(ci.Name); 97 lvClientControl.Items.Add(new ListViewItem(ci.Name, count, lvg)); 104 ListViewItem item = new ListViewItem(ci.Name, count, lvg); 105 lvClientControl.Items.Add(item); 106 clientInfoObjects.Add(ci.Id, item); 98 107 count = (count + 1) % 3; 99 108 } 100 109 lvClientControl.Groups.Add(lvg); 110 clientObjects.Add(cg.Id, lvg); 101 111 } // Groups 102 112 … … 124 134 private void AddJobs() { 125 135 try { 136 jobObjects = new Dictionary<long, ListViewItem>(); 126 137 IJobManager jobManager = 127 138 ServiceLocator.GetJobManager(); … … 140 151 if (job.State == State.calculating) { 141 152 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 0, lvJobCalculating); 153 jobObjects.Add(job.Id, lvi); 142 154 tvJobControl.Nodes[0].Nodes.Add(job.Id.ToString()); 143 155 lvJobControl.Items.Add(lvi); … … 145 157 } else if (job.State == State.finished) { 146 158 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 0, lvJobFinished); 159 jobObjects.Add(job.Id, lvi); 147 160 tvJobControl.Nodes[1].Nodes.Add(job.Id.ToString()); 148 161 lvJobControl.Items.Add(lvi); 149 162 } else if (job.State == State.offline) { 150 163 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 0, lvJobPending); 164 jobObjects.Add(job.Id, lvi); 151 165 tvJobControl.Nodes[2].Nodes.Add(job.Id.ToString()); 152 166 lvJobControl.Items.Add(lvi); … … 171 185 private void AddUsers() { 172 186 try { 187 userGroupsObjects = new Dictionary<long, ListViewGroup>(); 188 userListObjects = new Dictionary<long, ListViewItem>(); 173 189 IUserRoleManager userRoleManager = 174 190 ServiceLocator.GetUserRoleManager(); … … 187 203 User users = permOwner as User; 188 204 tvUserControl.Nodes[tvUserControl.Nodes.Count - 1].Nodes.Add(users.Name); 189 lvUserControl.Items.Add(new ListViewItem(users.Name, 0, lvg)); 205 ListViewItem item = new ListViewItem(users.Name, 0, lvg); 206 lvUserControl.Items.Add(item); 207 userListObjects.Add(users.Id, item); 190 208 } 191 209 } 192 210 lvUserControl.Groups.Add(lvg); 211 userGroupsObjects.Add(ug.Id, lvg); 193 212 194 213 } // Users … … 446 465 } 447 466 } 467 468 private void updaterWoker_DoWork(object sender, DoWorkEventArgs e) { 469 ResponseList<ClientInfo> clientInfoOld = clientInfo; 470 IClientManager clientManager = 471 ServiceLocator.GetClientManager(); 472 clientInfo = clientManager.GetAllClients(); 473 foreach (ClientInfo ci in clientInfo.List) { 474 foreach (ClientInfo cio in clientInfoOld.List) { 475 ci.Id.Equals(cio.Id); 476 } 477 } 478 479 } 448 480 #endregion 449 450 481 } 451 482 }
Note: See TracChangeset
for help on using the changeset viewer.