Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.3/Views/HiveJobPermissionView.cs @ 6792

Last change on this file since 6792 was 6792, checked in by ascheibe, 13 years ago

#1233 Hive Experiment Manager is now called Hive Job Manager

File size: 2.7 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2011 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.ComponentModel;
23using HeuristicLab.Clients.Hive.Views;
24using HeuristicLab.MainForm;
25
26namespace HeuristicLab.Clients.Hive.JobManager.Views {
27  [View("Hive Job Permission")]
28  [Content(typeof(JobPermission), true)]
29  public partial class HiveJobPermissionView : HiveItemView {
30    public new JobPermission Content {
31      get { return (JobPermission)base.Content; }
32      set { base.Content = value; }
33    }
34
35    public HiveJobPermissionView() {
36      InitializeComponent();
37      permissionComboBox.Items.Add(Permission.Read);
38      permissionComboBox.Items.Add(Permission.Full);
39      permissionComboBox.SelectedItem = Permission.Read;
40    }
41
42    protected override void OnContentChanged() {
43      base.OnContentChanged();
44      if (Content == null) {
45        usernameTextBox.Text = string.Empty;
46        permissionComboBox.SelectedIndex = 0;
47      } else {
48        usernameTextBox.Text = Content.GrantedUserName;
49        permissionComboBox.SelectedValue = Content.Permission;
50      }
51    }
52
53    protected override void SetEnabledStateOfControls() {
54      base.SetEnabledStateOfControls();
55      if (Content == null) {
56        usernameTextBox.Enabled = false;
57        permissionComboBox.Enabled = false;
58      } else {
59        usernameTextBox.Enabled = true;
60        permissionComboBox.Enabled = true;
61      }
62    }
63
64    #region Child Control Events
65
66    private void usernameTextBox_Validating(object sender, CancelEventArgs e) {
67      Content.GrantedUserName = usernameTextBox.Text;
68    }
69    private void usernameTextBox_Validated(object sender, System.EventArgs e) {
70
71    }
72
73    private void permissionComboBox_Validating(object sender, CancelEventArgs e) {
74      Content.Permission = (Permission)permissionComboBox.SelectedItem;
75    }
76    private void permissionComboBox_Validated(object sender, System.EventArgs e) {
77
78    }
79    #endregion
80  }
81}
Note: See TracBrowser for help on using the repository browser.