aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs26
1 files changed, 24 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs
index bbabed225..d0f6484ab 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Modules/DefaultPPCModuleLoader.cs
@@ -15,6 +15,7 @@ using Tango.PPC.Common;
using Tango.PPC.Jobs;
using System.Windows.Data;
using Tango.Core.DI;
+using Tango.Settings;
namespace Tango.PPC.UI.Modules
{
@@ -84,11 +85,21 @@ namespace Tango.PPC.UI.Modules
/// </summary>
public void LoadModules()
{
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
+
if (!_loaded)
{
//Preloaded
- LogManager.Log(String.Format("Loading module '{0}'...", nameof(JobsModule)));
- AllModules.Add(new JobsModule());
+ if (settings.UseJobsModuleV2)
+ {
+ LogManager.Log(String.Format("Loading module '{0}'...", nameof(JobsV2Module)));
+ AllModules.Add(new JobsV2Module());
+ }
+ else
+ {
+ LogManager.Log(String.Format("Loading module '{0}'...", nameof(JobsModule)));
+ AllModules.Add(new JobsModule());
+ }
//Preloaded
AllModules.Clear();
@@ -129,6 +140,17 @@ namespace Tango.PPC.UI.Modules
AllModules = AllModules.OrderBy(x => x.GetType().GetCustomAttribute<PPCModuleAttribute>().Index).ToObservableCollection();
+ if (settings.UseJobsModuleV2)
+ {
+ var legacyJobsModule = AllModules.SingleOrDefault(x => x.GetType() == typeof(JobsModule));
+ AllModules.Remove(legacyJobsModule);
+ }
+ else
+ {
+ var newJobsModule = AllModules.SingleOrDefault(x => x.GetType() == typeof(JobsV2Module));
+ AllModules.Remove(newJobsModule);
+ }
+
UserModules.Clear();
if (_authenticationProvider.AuthenticationRequired && _authenticationProvider.CurrentUser != null)