seb-win-refactoring/SafeExamBrowser.Runtime/Behaviour/Operations/RuntimeControllerOperation.cs

47 lines
1.2 KiB
C#
Raw Normal View History

2017-07-24 15:29:17 +02:00
/*
* Copyright (c) 2018 ETH Zürich, Educational Development and Technology (LET)
2017-07-24 15:29:17 +02:00
*
* 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/.
*/
using SafeExamBrowser.Contracts.Behaviour;
using SafeExamBrowser.Contracts.I18n;
using SafeExamBrowser.Contracts.Logging;
using SafeExamBrowser.Contracts.Runtime;
2017-07-24 15:29:17 +02:00
using SafeExamBrowser.Contracts.UserInterface;
namespace SafeExamBrowser.Runtime.Behaviour.Operations
2017-07-24 15:29:17 +02:00
{
internal class RuntimeControllerOperation : IOperation
2017-07-24 15:29:17 +02:00
{
private ILogger logger;
private IRuntimeController controller;
2017-07-24 15:29:17 +02:00
public ISplashScreen SplashScreen { private get; set; }
public RuntimeControllerOperation(IRuntimeController controller, ILogger logger)
2017-07-24 15:29:17 +02:00
{
this.controller = controller;
2017-07-24 15:29:17 +02:00
this.logger = logger;
}
public void Perform()
{
logger.Info("Starting event handling...");
SplashScreen.UpdateText(TextKey.SplashScreen_StartEventHandling);
2017-07-24 15:29:17 +02:00
controller.Start();
2017-07-24 15:29:17 +02:00
}
public void Revert()
{
logger.Info("Stopping event handling...");
SplashScreen.UpdateText(TextKey.SplashScreen_StopEventHandling);
2017-07-24 15:29:17 +02:00
controller.Stop();
2017-07-24 15:29:17 +02:00
}
}
}