Changeset 16032
- Timestamp:
- 07/30/18 14:23:46 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/CreateFromExperimentMenuItem.cs
r16025 r16032 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Threading.Tasks;25 24 using HeuristicLab.Core; 26 25 using HeuristicLab.MainForm; … … 43 42 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 44 43 45 //The ToolStripItem is Disabled by default.46 //If any of the following conditions apply, a Check for the user privilege can be omitted.47 44 ToolStripItem.Enabled = false; 48 45 if (activeView == null) { return; } … … 53 50 if (activeView.Locked) { return; } 54 51 55 //Check if the user has the required OKB permissions. 56 //In case of a server outage, a timeout may occur and the call takes a long time. 57 //To prevent a possible UI-freeze, the permission-check is implemented as async. 58 CheckPrivilege(); 59 } 60 61 private async void CheckPrivilege() { 62 await Task.Run(() => { 63 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 64 ToolStripItem.Enabled = OKBRoles.CheckUserPermissions(); 65 }); 52 ToolStripItem.Enabled = true; 66 53 } 67 54
Note: See TracChangeset
for help on using the changeset viewer.