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 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.ComponentModel;
|
---|
25 | using System.Data;
|
---|
26 | using System.Drawing;
|
---|
27 | using System.Linq;
|
---|
28 | using System.Text;
|
---|
29 | using System.Windows.Forms;
|
---|
30 | using HeuristicLab.Hive.Contracts.Interfaces;
|
---|
31 | using HeuristicLab.Hive.Contracts.BusinessObjects;
|
---|
32 |
|
---|
33 | namespace 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 |
|
---|
41 | List<ClientGroup> clients = null;
|
---|
42 | List<Job> jobs = null;
|
---|
43 | List<UserGroup> userGroups = null;
|
---|
44 |
|
---|
45 | public HiveServerManagementConsole() {
|
---|
46 | InitializeComponent();
|
---|
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 |
|
---|
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 | }
|
---|