Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Clients.Hive.Views/3.3/StateLog/StateLogView.cs @ 16329

Last change on this file since 16329 was 15584, checked in by swagner, 7 years ago

#2640: Updated year of copyrights in license headers on stable

File size: 3.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2018 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.Windows.Forms;
23using HeuristicLab.Core.Views;
24using HeuristicLab.MainForm;
25using HeuristicLab.MainForm.WindowsForms;
26
27namespace HeuristicLab.Clients.Hive.Views {
28  [View("StateLog View")]
29  [Content(typeof(StateLog), IsDefaultView = true)]
30  public sealed partial class StateLogView : ItemView {
31    public new StateLog Content {
32      get { return (StateLog)base.Content; }
33      set { base.Content = value; }
34    }
35
36    public StateLogView() {
37      InitializeComponent();
38    }
39
40    protected override void DeregisterContentEvents() {
41      // Deregister your event handlers here
42
43      base.DeregisterContentEvents();
44    }
45
46    protected override void RegisterContentEvents() {
47      base.RegisterContentEvents();
48      // Register your event handlers here
49
50    }
51
52    #region Event Handlers (Content)
53    // Put event handlers of the content here
54
55    #endregion
56
57    protected override void OnContentChanged() {
58      base.OnContentChanged();
59      if (Content == null) {
60        // Add code when content has been changed and is null
61        stateTextBox.Text = string.Empty;
62        dateTextBox.Text = string.Empty;
63        exceptionTextBox.Text = string.Empty;
64        userIdTextBox.Text = string.Empty;
65        slaveIdTextBox.Text = string.Empty;
66      } else {
67        // Add code when content has been changed and is not null
68        stateTextBox.Text = Content.State.ToString();
69        dateTextBox.Text = Content.DateTime.ToString();
70        exceptionTextBox.Text = Content.Exception;
71        userIdTextBox.Text = Content.UserId.ToString();
72        slaveIdTextBox.Text = Content.SlaveId.ToString();
73      }
74    }
75
76    protected override void SetEnabledStateOfControls() {
77      base.SetEnabledStateOfControls();
78      // Enable or disable controls based on whether the content is null or the view is set readonly
79      stateTextBox.ReadOnly = true;
80      dateTextBox.ReadOnly = true;
81      exceptionTextBox.ReadOnly = true;
82      userIdTextBox.ReadOnly = true;
83      slaveIdTextBox.ReadOnly = true;
84    }
85
86    #region Event Handlers (child controls)
87    // Put event handlers of child controls here.
88
89    #endregion
90  }
91}
Note: See TracBrowser for help on using the repository browser.