seb-win-refactoring/SafeExamBrowser.Core/Behaviour/Operations/EventControllerOperation.cs

46 lines
1.2 KiB
C#
Raw Normal View History

2017-07-24 15:29:17 +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/.
*/
using SafeExamBrowser.Contracts.Behaviour;
using SafeExamBrowser.Contracts.I18n;
using SafeExamBrowser.Contracts.Logging;
using SafeExamBrowser.Contracts.UserInterface;
namespace SafeExamBrowser.Core.Behaviour.Operations
{
public class EventControllerOperation : IOperation
2017-07-24 15:29:17 +02:00
{
private ILogger logger;
private IEventController controller;
2017-07-24 15:29:17 +02:00
public ISplashScreen SplashScreen { private get; set; }
public EventControllerOperation(IEventController 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(Key.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(Key.SplashScreen_StopEventHandling);
2017-07-24 15:29:17 +02:00
controller.Stop();
2017-07-24 15:29:17 +02:00
}
}
}