diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-10-11 12:17:48 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-10-11 12:17:48 +0300 |
| commit | a74cf2328f7231a465a74abd9bb05a57fa07d78d (patch) | |
| tree | 255e192586be93656c812f29382c2195c7ba3f29 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs | |
| parent | 4cf1319552fa1d694262f7bbc41ab4ea9991d457 (diff) | |
| parent | 37293ed1bf4ca876d9b90a20cfd3e4ead8f4bbf9 (diff) | |
| download | Tango-a74cf2328f7231a465a74abd9bb05a57fa07d78d.tar.gz Tango-a74cf2328f7231a465a74abd9bb05a57fa07d78d.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs index 13c3d6779..0def3c943 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs @@ -32,8 +32,8 @@ namespace Tango.MachineStudio.UI.Modules public DefaultStudioModuleLoader(IAuthenticationProvider authenticationProvider) { _authenticationProvider = authenticationProvider; - AllModules = new ObservableCollection<IStudioModule>(); - UserModules = new ObservableCollection<IStudioModule>(); + AllModules = new SynchronizedObservableCollection<IStudioModule>(); + UserModules = new SynchronizedObservableCollection<IStudioModule>(); _authenticationProvider.CurrentUserChanged += _authenticationProvider_CurrentUserChanged; } @@ -47,21 +47,21 @@ namespace Tango.MachineStudio.UI.Modules LoadModules(); } - private ObservableCollection<IStudioModule> _allModules; + private SynchronizedObservableCollection<IStudioModule> _allModules; /// <summary> /// Gets all loaded modules. /// </summary> - public ObservableCollection<IStudioModule> AllModules + public SynchronizedObservableCollection<IStudioModule> AllModules { get { return _allModules; } private set { _allModules = value; RaisePropertyChangedAuto(); } } - private ObservableCollection<IStudioModule> _userModules; + private SynchronizedObservableCollection<IStudioModule> _userModules; /// <summary> /// Gets all the user permitted modules. /// </summary> - public ObservableCollection<IStudioModule> UserModules + public SynchronizedObservableCollection<IStudioModule> UserModules { get { return _userModules; } private set { _userModules = value; RaisePropertyChangedAuto(); } @@ -121,13 +121,13 @@ namespace Tango.MachineStudio.UI.Modules _loaded = true; } - AllModules = AllModules.OrderBy(x => x.GetType().GetCustomAttribute<StudioModuleAttribute>().Index).ToObservableCollection(); + AllModules = AllModules.OrderBy(x => x.GetType().GetCustomAttribute<StudioModuleAttribute>().Index).ToSynchronizedObservableCollection(); UserModules.Clear(); if (_authenticationProvider.CurrentUser != null) { - UserModules = AllModules.Where(x => _authenticationProvider.CurrentUser.HasPermission(x.Permission)).ToObservableCollection(); + UserModules = AllModules.Where(x => _authenticationProvider.CurrentUser.HasPermission(x.Permission)).ToSynchronizedObservableCollection(); } ModulesLoaded?.Invoke(this, new EventArgs()); |
