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-06 10:56:03 +02:00
|
|
|
|
using System.Windows;
|
2017-07-06 18:18:39 +02:00
|
|
|
|
using SafeExamBrowser.Contracts.Configuration;
|
|
|
|
|
using SafeExamBrowser.Contracts.I18n;
|
|
|
|
|
using SafeExamBrowser.Contracts.Logging;
|
2017-07-07 15:46:32 +02:00
|
|
|
|
using SafeExamBrowser.Contracts.UserInterface;
|
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-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-06 18:18:39 +02:00
|
|
|
|
public ILogger Logger { get; private set; }
|
2017-07-07 15:46:32 +02:00
|
|
|
|
public IMessageBox MessageBox { get; private set; }
|
2017-07-06 18:18:39 +02:00
|
|
|
|
public ISettings Settings { get; private set; }
|
2017-07-07 15:46:32 +02:00
|
|
|
|
public IShutdownController ShutdownController { get; set; }
|
|
|
|
|
public ISplashScreen SplashScreen { get; private set; }
|
|
|
|
|
public IStartupController StartupController { get; private set; }
|
2017-07-06 18:18:39 +02:00
|
|
|
|
public IText Text { get; private set; }
|
2017-07-06 10:56:03 +02:00
|
|
|
|
public Window Taskbar { get; private set; }
|
|
|
|
|
|
2017-07-07 15:46:32 +02:00
|
|
|
|
public void BuildObjectGraph()
|
2017-07-06 10:56:03 +02:00
|
|
|
|
{
|
2017-07-07 15:46:32 +02:00
|
|
|
|
MessageBox = new WpfMessageBox();
|
2017-07-06 18:18:39 +02:00
|
|
|
|
Settings = new Settings();
|
2017-07-07 15:46:32 +02:00
|
|
|
|
SplashScreen = new UserInterface.SplashScreen();
|
|
|
|
|
Taskbar = new Taskbar();
|
|
|
|
|
Text = new Text(new XmlTextResource());
|
|
|
|
|
|
2017-07-06 18:18:39 +02:00
|
|
|
|
Logger = new Logger();
|
|
|
|
|
Logger.Subscribe(new LogFileWriter(Settings));
|
2017-07-06 10:56:03 +02:00
|
|
|
|
|
2017-07-07 15:46:32 +02:00
|
|
|
|
ShutdownController = new ShutdownController(Logger, MessageBox, Text);
|
|
|
|
|
StartupController = new StartupController(Logger, MessageBox, SplashScreen, Text);
|
2017-07-06 10:56:03 +02:00
|
|
|
|
}
|
2017-07-05 11:41:19 +02:00
|
|
|
|
}
|
|
|
|
|
}
|