Changeset 15401 for branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/MenuItems
- Timestamp:
- 10/04/17 13:56:38 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/MenuItems/AdministratorMenuItem.cs
r14185 r15401 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 using HeuristicLab.Clients.Hive; 24 using System.Windows.Forms; 25 using HeuristicLab.Clients.Access; 24 26 using HeuristicLab.MainForm; 27 using HeuristicLab.Optimizer; 25 28 26 namespace HeuristicLab. Optimizer.MenuItems{27 public class AdministratorMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {29 namespace HeuristicLab.Clients.Hive.Administrator { 30 public class AdministratorMenuItem : MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider { 28 31 public override string Name { 29 32 get { return "&Administrator"; } 30 33 } 34 31 35 public override IEnumerable<string> Structure { 32 36 get { return new string[] { "&Services", "&Hive" }; } 33 37 } 38 34 39 public override void Execute() { 35 MainFormManager.MainForm.ShowContent(HiveAdminClient.Instance); 40 if (HiveRoles.CheckAdminUserPermissions()) { 41 MainFormManager.MainForm.ShowContent(HiveAdminClient.Instance); 42 } else if (!UserInformation.Instance.UserExists) { 43 MessageBox.Show( 44 "Couldn't fetch user information from the server." + Environment.NewLine + 45 "Please verify that you have an existing user and that your user name and password is correct.", 46 "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error); 47 } else { 48 MessageBox.Show( 49 "You do not seem to have the permissions to use the Hive Administrator." + Environment.NewLine + 50 "If that's not the case or you have any questions please write an email to support@heuristiclab.com", 51 "HeuristicLab Hive Administrator", MessageBoxButtons.OK, MessageBoxIcon.Error); 52 } 36 53 } 54 37 55 public override int Position { 38 get { return 10000; } 56 get { return 8000; } 57 } 58 59 public override Keys ShortCutKeys { 60 get { return Keys.Control | Keys.Shift | Keys.H; } 39 61 } 40 62 }
Note: See TracChangeset
for help on using the changeset viewer.