diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs | 18 |
1 files changed, 12 insertions, 6 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 9b57da988..0f65f833e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -37,6 +37,8 @@ using Tango.PPC.Common.Synchronization; using Tango.Insights; using System.Threading; using System.Reflection; +using Tango.PPC.UI.ViewsContracts; +using Tango.PPC.Common.Build; namespace Tango.PPC.UI.PPCApplication { @@ -55,6 +57,7 @@ namespace Tango.PPC.UI.PPCApplication private IPPCModuleLoader _moduleLoader; private INotificationProvider _notificationProvider; private IMachineDataSynchronizer _machineDataSynchronizer; + private IBuildProvider _buildProvider; private WatchDogServer _watchdogServer; private ObservablesContext _machineContext; private ActionTimer _screenLockTimer; @@ -201,7 +204,7 @@ namespace Tango.PPC.UI.PPCApplication /// <summary> /// Initializes a new instance of the <see cref="DefaultPPCApplicationManager"/> class. /// </summary> - public DefaultPPCApplicationManager(IMachineProvider machineProvider, IDispatcherProvider dispatcherProvider, IEventLogger eventLogger, IPPCModuleLoader moduleLoader, INotificationProvider notificationProvider, IMachineDataSynchronizer machineDataSynchronizer) + public DefaultPPCApplicationManager(IMachineProvider machineProvider, IDispatcherProvider dispatcherProvider, IEventLogger eventLogger, IPPCModuleLoader moduleLoader, INotificationProvider notificationProvider, IMachineDataSynchronizer machineDataSynchronizer, IBuildProvider buildProvider) { StartPath = AssemblyHelper.GetCurrentAssemblyFolder(); @@ -211,6 +214,7 @@ namespace Tango.PPC.UI.PPCApplication _eventLogger = eventLogger; _moduleLoader = moduleLoader; _machineDataSynchronizer = machineDataSynchronizer; + _buildProvider = buildProvider; if (!DesignMode) { @@ -255,7 +259,7 @@ namespace Tango.PPC.UI.PPCApplication //Start watchdog _watchdogServer = new WatchDogServer(Application.Current.Dispatcher); -#if !DEBUG +#if (!DEBUG && !Eureka) if (settings.EnableWatchDog) { @@ -289,7 +293,7 @@ namespace Tango.PPC.UI.PPCApplication settings.ApplicationState = ApplicationStates.Ready; settings.Save(); - if (isAfterSetup) + if (isAfterSetup && !_buildProvider.IsEureka) { SystemRestartRequired?.Invoke(this, new EventArgs()); return; @@ -380,6 +384,8 @@ namespace Tango.PPC.UI.PPCApplication { LogManager.Log("Module loader instance has been registered. Registering for the ModulesLoaded event..."); + ILayoutView layoutView = TangoIOC.Default.GetInstance<ILayoutView>(); + loader.ModulesLoaded += (x, y) => { LogManager.Log("Loading modules views"); @@ -387,14 +393,14 @@ namespace Tango.PPC.UI.PPCApplication { foreach (var module in TangoIOC.Default.GetInstance<IPPCModuleLoader>().UserModules) { - if (!Views.LayoutView.Instance.NavigationControl.Elements.ToList().Exists(m => m.GetType() == module.MainViewType)) + if (!layoutView.GetNavigationControl().Elements.ToList().Exists(m => m.GetType() == module.MainViewType)) { try { 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); + layoutView.GetNavigationControl().Elements.Add(view); } catch (Exception ex) { @@ -411,7 +417,7 @@ namespace Tango.PPC.UI.PPCApplication 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); + layoutView.GetNavigationControl().Elements.Add(view); _moduleLoader.AllModules.Add(module); _moduleLoader.UserModules.Add(module); } |
