source: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/HiveExperimentPermissionView.cs @ 6479

Last change on this file since 6479 was 6479, checked in by cneumuel, 8 years ago

#1233

  • finished experiment sharing
  • added role for executing privileged jobs
  • refreshing experiments in experimentManager does not delete already downloaded jobs
  • moved some properties from HiveExperiment into RefreshableHiveExperiment
File size: 2.8 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.ExperimentManager.Views {
27  [View("HiveExperimentPermission View")]
28  [Content(typeof(HiveExperimentPermission), true)]
29  public partial class HiveExperimentPermissionView : HiveItemView {
30    public new HiveExperimentPermission Content {
31      get { return (HiveExperimentPermission)base.Content; }
32      set { base.Content = value; }
33    }
34
35    public HiveExperimentPermissionView() {
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.