diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 206aa112b..149fb549f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -328,6 +328,8 @@ namespace Tango.PPC.UI.PPCApplication } } + var internalModules = this.GetType().Assembly.GetTypes().Where(xx => typeof(PPCModuleBase).IsAssignableFrom(xx)).ToList(); + LogManager.Log("Waiting for IPPCModuleLoader instance injection..."); TangoIOC.Default.GetInstanceWhenAvailable<IPPCModuleLoader>((loader) => { @@ -355,6 +357,19 @@ namespace Tango.PPC.UI.PPCApplication } } } + + //Adding internal modules. + LogManager.Log("Loading internal modules..."); + foreach (var type in internalModules) + { + var module = Activator.CreateInstance(type) as IPPCModule; + LogManager.Log("Loading module view " + module.Name + "..."); + FrameworkElement view = Activator.CreateInstance(module.MainViewType) as FrameworkElement; + SharedUI.Controls.NavigationControl.SetNavigationName(view, module.Name); + Views.LayoutView.Instance.NavigationControl.Elements.Add(view); + _moduleLoader.AllModules.Add(module); + _moduleLoader.UserModules.Add(module); + } }); LogManager.Log($"{loader.UserModules.Count} modules loaded."); |
