Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs @ 833

Last change on this file since 833 was 831, checked in by aleitner, 16 years ago

Integrated interfaces to the server (Client, User, Jobs) (#380)

File size: 3.0 KB
RevLine 
[794]1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.ComponentModel;
25using System.Data;
26using System.Drawing;
27using System.Linq;
28using System.Text;
29using System.Windows.Forms;
[831]30using HeuristicLab.Hive.Contracts.Interfaces;
31using HeuristicLab.Hive.Contracts.BusinessObjects;
[794]32
33namespace HeuristicLab.Hive.Server.Console {
34
35  public delegate void closeForm(bool cf);
36
37  public partial class HiveServerManagementConsole : Form {
38
39    public event closeForm closeFormEvent;
40
[831]41    List<ClientGroup> clients = null;
42    List<Job> jobs = null;
43    List<UserGroup> userGroups = null;
44   
[794]45    public HiveServerManagementConsole() {
46      InitializeComponent();
[831]47
48      IClientManager clientManager =
49        ServiceLocator.GetClientManager();
50
51      IJobManager jobManager =
52        ServiceLocator.GetJobManager();
53
54      IUserRoleManager userRoleManager =
55        ServiceLocator.GetUserRoleManager();
56
57     // clients = clientManager.GetAllClientGroups();
58      jobs = jobManager.GetAllJobs();
59      userGroups = userRoleManager.GetAllUserGroups();
60     // foreach (ClientGroup cg in clients) {
61     //   tvClientControl.Nodes.Add(cg.Name);
62        foreach (ClientInfo ci in clientManager.GetAllClients()) {
63          tvClientControl.SelectedNode.Nodes.Add(ci.name);
64        }
65     // }
66      foreach (Job job in jobs) {
67        tvJobControl.Nodes.Add(job.JobId.ToString());
68      }
69      foreach (UserGroup ug in userGroups) {
70        tvUserControl.Nodes.Add(ug.UserGroupId.ToString());
71      }
72
[794]73    }
74
75    /// <summary>
76    /// Send event to Login-GUI when closing
77    /// </summary>
78    /// <param name="sender"></param>
79    /// <param name="e"></param>
80    private void close_Click(object sender, EventArgs e) {
81      if (closeFormEvent != null) {
82        closeFormEvent(true);
83      }
84      this.Close();
85    }
86
87    /// <summary>
88    /// Send evnt to Login-GUI when closing
89    /// </summary>
90    /// <param name="sender"></param>
91    /// <param name="e"></param>
92    private void HiveServerConsoleInformation_FormClosing(object sender, FormClosingEventArgs e) {
93      if (closeFormEvent != null) {
94        closeFormEvent(true);
95      }
96
97    }
98  }
99}
Note: See TracBrowser for help on using the repository browser.