2017-07-05 11:41:19 +02:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2017 ETH Zürich, Educational Development and Technology (LET)
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-07-12 15:36:30 +02:00
|
|
|
|
using SafeExamBrowser.Browser;
|
|
|
|
|
using SafeExamBrowser.Contracts.Behaviour;
|
2017-07-13 08:51:00 +02:00
|
|
|
|
using SafeExamBrowser.Contracts.Configuration;
|
|
|
|
|
using SafeExamBrowser.Contracts.I18n;
|
|
|
|
|
using SafeExamBrowser.Contracts.Logging;
|
2017-07-19 14:43:54 +02:00
|
|
|
|
using SafeExamBrowser.Contracts.Monitoring;
|
2017-07-13 08:51:00 +02:00
|
|
|
|
using SafeExamBrowser.Contracts.UserInterface;
|
2017-07-12 15:36:30 +02:00
|
|
|
|
using SafeExamBrowser.Core.Behaviour;
|
2017-07-06 18:18:39 +02:00
|
|
|
|
using SafeExamBrowser.Core.Configuration;
|
2017-07-05 17:21:52 +02:00
|
|
|
|
using SafeExamBrowser.Core.I18n;
|
2017-07-06 18:18:39 +02:00
|
|
|
|
using SafeExamBrowser.Core.Logging;
|
2017-07-19 14:43:54 +02:00
|
|
|
|
using SafeExamBrowser.Monitoring.Processes;
|
2017-07-06 10:56:03 +02:00
|
|
|
|
using SafeExamBrowser.UserInterface;
|
2017-07-05 17:21:52 +02:00
|
|
|
|
|
2017-07-06 10:56:03 +02:00
|
|
|
|
namespace SafeExamBrowser
|
2017-07-05 11:41:19 +02:00
|
|
|
|
{
|
2017-07-07 15:46:32 +02:00
|
|
|
|
internal class CompositionRoot
|
2017-07-05 11:41:19 +02:00
|
|
|
|
{
|
2017-07-14 10:28:59 +02:00
|
|
|
|
private IApplicationController browserController;
|
2017-07-13 08:51:00 +02:00
|
|
|
|
private IApplicationInfo browserInfo;
|
2017-07-19 14:43:54 +02:00
|
|
|
|
private ILogger logger;
|
2017-07-13 08:51:00 +02:00
|
|
|
|
private IMessageBox messageBox;
|
2017-07-17 16:59:50 +02:00
|
|
|
|
private INotificationInfo aboutInfo;
|
2017-07-19 14:43:54 +02:00
|
|
|
|
private IProcessMonitor processMonitor;
|
|
|
|
|
private ISettings settings;
|
|
|
|
|
private IText text;
|
2017-07-13 08:51:00 +02:00
|
|
|
|
private IUiElementFactory uiFactory;
|
2017-07-19 14:43:54 +02:00
|
|
|
|
private ITextResource textResource;
|
2017-07-12 15:36:30 +02:00
|
|
|
|
|
2017-07-13 08:51:00 +02:00
|
|
|
|
public IShutdownController ShutdownController { get; private set; }
|
|
|
|
|
public IStartupController StartupController { get; private set; }
|
2017-07-10 15:47:12 +02:00
|
|
|
|
public Taskbar Taskbar { get; private set; }
|
2017-07-13 08:51:00 +02:00
|
|
|
|
|
2017-07-07 15:46:32 +02:00
|
|
|
|
public void BuildObjectGraph()
|
2017-07-06 10:56:03 +02:00
|
|
|
|
{
|
2017-07-14 10:28:59 +02:00
|
|
|
|
browserController = new BrowserApplicationController();
|
|
|
|
|
browserInfo = new BrowserApplicationInfo();
|
|
|
|
|
logger = new Logger();
|
2017-07-17 16:59:50 +02:00
|
|
|
|
messageBox = new WpfMessageBox();
|
2017-07-19 14:43:54 +02:00
|
|
|
|
settings = new Settings();
|
2017-07-14 10:28:59 +02:00
|
|
|
|
Taskbar = new Taskbar();
|
2017-07-19 14:43:54 +02:00
|
|
|
|
textResource = new XmlTextResource();
|
2017-07-17 16:59:50 +02:00
|
|
|
|
uiFactory = new UiElementFactory();
|
2017-07-14 10:28:59 +02:00
|
|
|
|
|
2017-07-19 14:43:54 +02:00
|
|
|
|
logger.Subscribe(new LogFileWriter(settings));
|
2017-07-06 10:56:03 +02:00
|
|
|
|
|
2017-07-19 14:43:54 +02:00
|
|
|
|
text = new Text(textResource);
|
|
|
|
|
aboutInfo = new AboutNotificationInfo(text);
|
|
|
|
|
processMonitor = new ProcessMonitor(logger);
|
|
|
|
|
ShutdownController = new ShutdownController(logger, messageBox, processMonitor, settings, text, uiFactory);
|
|
|
|
|
StartupController = new StartupController(browserController, browserInfo, logger, messageBox, aboutInfo, processMonitor, settings, Taskbar, text, uiFactory);
|
2017-07-06 10:56:03 +02:00
|
|
|
|
}
|
2017-07-05 11:41:19 +02:00
|
|
|
|
}
|
|
|
|
|
}
|