Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/SlaveView.cs @ 15517

Last change on this file since 15517 was 15422, checked in by jkarder, 7 years ago

#2839: worked on resources and projects views

File size: 2.6 KB
RevLine 
[6976]1#region License Information
2/* HeuristicLab
[15422]3 * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
[6976]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.Windows.Forms;
24using HeuristicLab.MainForm;
25using HeuristicLab.MainForm.WindowsForms;
26
27namespace HeuristicLab.Clients.Hive.Administrator.Views {
[15422]28  [View("Slave View")]
29  [Content(typeof(Slave), IsDefaultView = true)]
30  public sealed partial class SlaveView : ResourceView {
31    public new Slave Content {
32      get { return (Slave)base.Content; }
[6976]33      set { base.Content = value; }
34    }
35
36    public SlaveView() {
37      InitializeComponent();
38    }
39
[15422]40    #region Overrides
[6976]41    protected override void OnContentChanged() {
42      base.OnContentChanged();
43      if (Content == null) {
[15422]44        cpuTextBox.Clear();
45        memoryTextBox.Clear();
46        operatingSystemTextBox.Clear();
47        stateTextBox.Clear();
48        lastHeartbeatTextBox.Clear();
49        disposableCheckBox.Checked = false;
[6976]50      } else {
[15422]51        cpuTextBox.Text = string.Format("{0} Cores @ {1} MHz, Arch.: {2}", Content.Cores, Content.CpuSpeed, Content.CpuArchitecture);
52        memoryTextBox.Text = string.Format("{0} ({1} Free)", Content.Memory, Content.FreeMemory);
53        operatingSystemTextBox.Text = Content.OperatingSystem;
54        stateTextBox.Text = Content.SlaveState.ToString();
55        lastHeartbeatTextBox.Text = Content.LastHeartbeat.ToString();
56        disposableCheckBox.Checked = Content.IsDisposable.GetValueOrDefault();
[6976]57      }
58    }
59
60    protected override void SetEnabledStateOfControls() {
61      base.SetEnabledStateOfControls();
[15422]62      disposableCheckBox.Enabled = Content != null;
[6976]63    }
[15422]64    #endregion
[6976]65
[15422]66    #region Event Handlers
67    private void disposableCheckBox_CheckedChanged(object sender, EventArgs e) {
68      if (Content != null)
69        Content.IsDisposable = disposableCheckBox.Checked;
[6976]70    }
[15422]71    #endregion
[6976]72  }
73}
Note: See TracBrowser for help on using the repository browser.