From 2ea2bb5bcd96045f1bd6cb4c3d8b8416dbaa05dc Mon Sep 17 00:00:00 2001 From: Roy Date: Tue, 26 Dec 2017 21:16:15 +0200 Subject: MERGE --- .../Modules/DefaultStudioModuleLoader.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules') 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 689ac7b38..9a8a6bc96 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Modules/DefaultStudioModuleLoader.cs @@ -10,6 +10,7 @@ using Tango.Core; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Authentication; using Tango.MachineStudio.Common.Modules; +using Tango.MachineStudio.Stubs; namespace Tango.MachineStudio.UI.Modules { @@ -49,6 +50,10 @@ namespace Tango.MachineStudio.UI.Modules { if (!_loaded) { + //Preloaded + AllModules.Add(new StubsModule()); + //Preloaded + AllModules.Clear(); string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -63,8 +68,11 @@ namespace Tango.MachineStudio.UI.Modules { foreach (var moduleType in moduleAssembly.GetTypes().Where(x => !x.IsInterface && typeof(IStudioModule).IsAssignableFrom(x))) { - var module = Activator.CreateInstance(moduleType) as IStudioModule; - AllModules.Add(module); + if (!AllModules.ToList().Exists(x => x.GetType() == moduleType)) + { + var module = Activator.CreateInstance(moduleType) as IStudioModule; + AllModules.Add(module); + } } } } -- cgit v1.3.1