diff --git a/SafeExamBrowser.Configuration/Settings/Settings.cs b/SafeExamBrowser.Configuration/Settings/Settings.cs index 34449e5f..f7b8b67a 100644 --- a/SafeExamBrowser.Configuration/Settings/Settings.cs +++ b/SafeExamBrowser.Configuration/Settings/Settings.cs @@ -15,6 +15,7 @@ namespace SafeExamBrowser.Configuration.Settings internal class Settings : ISettings { public ConfigurationMode ConfigurationMode { get; set; } + public ServicePolicy ServicePolicy { get; set; } public IBrowserSettings Browser { get; set; } public IKeyboardSettings Keyboard { get; set; } diff --git a/SafeExamBrowser.Contracts/Communication/IClientProxy.cs b/SafeExamBrowser.Contracts/Communication/IClientProxy.cs new file mode 100644 index 00000000..26350cc2 --- /dev/null +++ b/SafeExamBrowser.Contracts/Communication/IClientProxy.cs @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2018 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 System; + +namespace SafeExamBrowser.Contracts.Communication +{ + public interface IClientProxy + { + bool Connect(Guid token); + } +} diff --git a/SafeExamBrowser.Contracts/Communication/ICommunicationHost.cs b/SafeExamBrowser.Contracts/Communication/ICommunication.cs similarity index 97% rename from SafeExamBrowser.Contracts/Communication/ICommunicationHost.cs rename to SafeExamBrowser.Contracts/Communication/ICommunication.cs index 386af226..5009e8f0 100644 --- a/SafeExamBrowser.Contracts/Communication/ICommunicationHost.cs +++ b/SafeExamBrowser.Contracts/Communication/ICommunication.cs @@ -14,7 +14,7 @@ using SafeExamBrowser.Contracts.Communication.Responses; namespace SafeExamBrowser.Contracts.Communication { [ServiceContract(SessionMode = SessionMode.Required)] - public interface ICommunicationHost + public interface ICommunication { /// /// Initiates a connection to the host and must thus be called before any other opertion. To authenticate itself to the host, the diff --git a/SafeExamBrowser.Contracts/Communication/IRuntimeProxy.cs b/SafeExamBrowser.Contracts/Communication/IRuntimeProxy.cs new file mode 100644 index 00000000..13e9ccbd --- /dev/null +++ b/SafeExamBrowser.Contracts/Communication/IRuntimeProxy.cs @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2018 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 System; + +namespace SafeExamBrowser.Contracts.Communication +{ + public interface IRuntimeProxy + { + bool Connect(Guid token); + } +} diff --git a/SafeExamBrowser.Contracts/Communication/IServiceProxy.cs b/SafeExamBrowser.Contracts/Communication/IServiceProxy.cs new file mode 100644 index 00000000..257bfab9 --- /dev/null +++ b/SafeExamBrowser.Contracts/Communication/IServiceProxy.cs @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018 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/. + */ + +namespace SafeExamBrowser.Contracts.Communication +{ + public interface IServiceProxy + { + /// + /// Tries to connect to the service host. + /// + bool Connect(); + + /// + /// Disconnects from the service host. + /// + void Disconnect(); + } +} diff --git a/SafeExamBrowser.Contracts/Communication/Messages/IMessage.cs b/SafeExamBrowser.Contracts/Communication/Messages/IMessage.cs index 52d1a51e..8dd53011 100644 --- a/SafeExamBrowser.Contracts/Communication/Messages/IMessage.cs +++ b/SafeExamBrowser.Contracts/Communication/Messages/IMessage.cs @@ -7,11 +7,10 @@ */ using System; -using System.Runtime.Serialization; namespace SafeExamBrowser.Contracts.Communication.Messages { - public interface IMessage : ISerializable + public interface IMessage { /// /// The communication token needed for authentication with the host. diff --git a/SafeExamBrowser.Contracts/Communication/Responses/IResponse.cs b/SafeExamBrowser.Contracts/Communication/Responses/IResponse.cs index 51562212..94ae6427 100644 --- a/SafeExamBrowser.Contracts/Communication/Responses/IResponse.cs +++ b/SafeExamBrowser.Contracts/Communication/Responses/IResponse.cs @@ -6,11 +6,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -using System.Runtime.Serialization; - namespace SafeExamBrowser.Contracts.Communication.Responses { - public interface IResponse : ISerializable + public interface IResponse { } } diff --git a/SafeExamBrowser.Contracts/Configuration/Settings/ConfigurationMode.cs b/SafeExamBrowser.Contracts/Configuration/Settings/ConfigurationMode.cs index fb208a1a..53419abc 100644 --- a/SafeExamBrowser.Contracts/Configuration/Settings/ConfigurationMode.cs +++ b/SafeExamBrowser.Contracts/Configuration/Settings/ConfigurationMode.cs @@ -10,7 +10,16 @@ namespace SafeExamBrowser.Contracts.Configuration.Settings { public enum ConfigurationMode { + /// + /// In this mode, the application settings shall be used to configure the local client settings of a user. When running in this + /// mode, the user has the possiblity to re-configure the application during runtime. + /// ConfigureClient, + + /// + /// In this mode, the application settings shall only be used to start an exam. When running in this mode, the user cannot re- + /// configure the application during runtime. + /// Exam } } diff --git a/SafeExamBrowser.Contracts/Configuration/Settings/ISettings.cs b/SafeExamBrowser.Contracts/Configuration/Settings/ISettings.cs index b27ba7e5..21dbda4e 100644 --- a/SafeExamBrowser.Contracts/Configuration/Settings/ISettings.cs +++ b/SafeExamBrowser.Contracts/Configuration/Settings/ISettings.cs @@ -30,6 +30,11 @@ namespace SafeExamBrowser.Contracts.Configuration.Settings /// IMouseSettings Mouse { get; } + /// + /// The active service policy. + /// + ServicePolicy ServicePolicy { get; } + /// /// All taskbar-related settings. /// diff --git a/SafeExamBrowser.Contracts/Configuration/Settings/ServicePolicy.cs b/SafeExamBrowser.Contracts/Configuration/Settings/ServicePolicy.cs new file mode 100644 index 00000000..4eba42ae --- /dev/null +++ b/SafeExamBrowser.Contracts/Configuration/Settings/ServicePolicy.cs @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018 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/. + */ + +namespace SafeExamBrowser.Contracts.Configuration.Settings +{ + public enum ServicePolicy + { + /// + /// The service component must be running. If it is not running, the user won't be able to start the application. + /// + Mandatory, + + /// + /// The service component is optional. If it is not running, all service-related actions are simply skipped. + /// + Optional + } +} diff --git a/SafeExamBrowser.Contracts/I18n/TextKey.cs b/SafeExamBrowser.Contracts/I18n/TextKey.cs index a44828b5..7bbb25cf 100644 --- a/SafeExamBrowser.Contracts/I18n/TextKey.cs +++ b/SafeExamBrowser.Contracts/I18n/TextKey.cs @@ -25,10 +25,12 @@ namespace SafeExamBrowser.Contracts.I18n MessageBox_StartupErrorTitle, Notification_AboutTooltip, Notification_LogTooltip, + SplashScreen_CloseServiceConnection, SplashScreen_EmptyClipboard, SplashScreen_InitializeBrowser, SplashScreen_InitializeConfiguration, SplashScreen_InitializeProcessMonitoring, + SplashScreen_InitializeServiceConnection, SplashScreen_InitializeTaskbar, SplashScreen_InitializeWindowMonitoring, SplashScreen_InitializeWorkingArea, diff --git a/SafeExamBrowser.Contracts/SafeExamBrowser.Contracts.csproj b/SafeExamBrowser.Contracts/SafeExamBrowser.Contracts.csproj index c8f5181c..0542128f 100644 --- a/SafeExamBrowser.Contracts/SafeExamBrowser.Contracts.csproj +++ b/SafeExamBrowser.Contracts/SafeExamBrowser.Contracts.csproj @@ -55,7 +55,10 @@ - + + + + @@ -78,6 +81,7 @@ + diff --git a/SafeExamBrowser.Core/Communication/CommunicationHostProxy.cs b/SafeExamBrowser.Core/Communication/BaseProxy.cs similarity index 70% rename from SafeExamBrowser.Core/Communication/CommunicationHostProxy.cs rename to SafeExamBrowser.Core/Communication/BaseProxy.cs index c2739109..78515813 100644 --- a/SafeExamBrowser.Core/Communication/CommunicationHostProxy.cs +++ b/SafeExamBrowser.Core/Communication/BaseProxy.cs @@ -15,30 +15,33 @@ using SafeExamBrowser.Contracts.Logging; namespace SafeExamBrowser.Core.Communication { - public class CommunicationHostProxy : ICommunicationHost + public abstract class BaseProxy : ICommunication { private string address; - private ILogger logger; - private ICommunicationHost channel; + private ICommunication channel; - public CommunicationHostProxy(ILogger logger, string address) + protected Guid? CommunicationToken { get; private set; } + protected ILogger Logger { get; private set; } + + public BaseProxy(ILogger logger, string address) { this.address = address; - this.logger = logger; + this.Logger = logger; } public IConnectResponse Connect(Guid? token = null) { var endpoint = new EndpointAddress(address); - channel = ChannelFactory.CreateChannel(new NetNamedPipeBinding(NetNamedPipeSecurityMode.Transport), endpoint); + channel = ChannelFactory.CreateChannel(new NetNamedPipeBinding(NetNamedPipeSecurityMode.Transport), endpoint); (channel as ICommunicationObject).Closed += CommunicationHostProxy_Closed; (channel as ICommunicationObject).Closing += CommunicationHostProxy_Closing; (channel as ICommunicationObject).Faulted += CommunicationHostProxy_Faulted; var response = channel.Connect(token); - logger.Debug($"Tried to connect to {address}, connection was {(response.ConnectionEstablished ? "established" : "refused")}."); + CommunicationToken = response.CommunicationToken; + Logger.Debug($"Tried to connect to {address}, connection was {(response.ConnectionEstablished ? "established" : "refused")}."); return response; } @@ -48,7 +51,7 @@ namespace SafeExamBrowser.Core.Communication if (ChannelIsReady()) { channel.Disconnect(message); - logger.Debug($"Disconnected from {address}, transmitting {ToString(message)}."); + Logger.Debug($"Disconnected from {address}, transmitting {ToString(message)}."); } throw new CommunicationException($"Tried to disconnect from host, but channel was {GetChannelState()}!"); @@ -60,7 +63,7 @@ namespace SafeExamBrowser.Core.Communication { var response = channel.Send(message); - logger.Debug($"Sent {ToString(message)}, got {ToString(response)}."); + Logger.Debug($"Sent {ToString(message)}, got {ToString(response)}."); return response; } @@ -68,6 +71,14 @@ namespace SafeExamBrowser.Core.Communication throw new CommunicationException($"Tried to send {ToString(message)}, but channel was {GetChannelState()}!"); } + protected void FailIfNotConnected(string operationName) + { + if (!CommunicationToken.HasValue) + { + throw new InvalidOperationException($"Cannot perform '{operationName}' before being connected to endpoint!"); + } + } + private bool ChannelIsReady() { return channel != null && (channel as ICommunicationObject).State == CommunicationState.Opened; @@ -75,17 +86,17 @@ namespace SafeExamBrowser.Core.Communication private void CommunicationHostProxy_Closed(object sender, EventArgs e) { - logger.Debug("Communication channel has been closed."); + Logger.Debug("Communication channel has been closed."); } private void CommunicationHostProxy_Closing(object sender, EventArgs e) { - logger.Debug("Communication channel is closing."); + Logger.Debug("Communication channel is closing."); } private void CommunicationHostProxy_Faulted(object sender, EventArgs e) { - logger.Error("Communication channel has faulted!"); + Logger.Error("Communication channel has faulted!"); } private string GetChannelState() diff --git a/SafeExamBrowser.Core/Communication/Messages/Message.cs b/SafeExamBrowser.Core/Communication/Messages/Message.cs new file mode 100644 index 00000000..27c60c70 --- /dev/null +++ b/SafeExamBrowser.Core/Communication/Messages/Message.cs @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2018 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 System; +using SafeExamBrowser.Contracts.Communication.Messages; + +namespace SafeExamBrowser.Core.Communication.Messages +{ + [Serializable] + internal class Message : IMessage + { + public Guid CommunicationToken { get; set; } + } +} diff --git a/SafeExamBrowser.Core/Communication/ServiceProxy.cs b/SafeExamBrowser.Core/Communication/ServiceProxy.cs new file mode 100644 index 00000000..5df74154 --- /dev/null +++ b/SafeExamBrowser.Core/Communication/ServiceProxy.cs @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018 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 System; +using SafeExamBrowser.Contracts.Communication; +using SafeExamBrowser.Contracts.Logging; +using SafeExamBrowser.Core.Communication.Messages; + +namespace SafeExamBrowser.Core.Communication +{ + public class ServiceProxy : BaseProxy, IServiceProxy + { + public ServiceProxy(ILogger logger, string address) : base(logger, address) + { + } + + public bool Connect() + { + throw new NotImplementedException(); + } + + public void Disconnect() + { + FailIfNotConnected(nameof(Disconnect)); + + Disconnect(new Message { CommunicationToken = CommunicationToken.Value }); + } + } +} diff --git a/SafeExamBrowser.Core/I18n/Text.xml b/SafeExamBrowser.Core/I18n/Text.xml index e242e96c..29c41c97 100644 --- a/SafeExamBrowser.Core/I18n/Text.xml +++ b/SafeExamBrowser.Core/I18n/Text.xml @@ -30,6 +30,9 @@ Application Log + + Closing service connection + Emptying clipboard @@ -42,6 +45,9 @@ Initializing process monitoring + + Initializing service connection + Initializing taskbar diff --git a/SafeExamBrowser.Core/SafeExamBrowser.Core.csproj b/SafeExamBrowser.Core/SafeExamBrowser.Core.csproj index b5f686b1..70a90245 100644 --- a/SafeExamBrowser.Core/SafeExamBrowser.Core.csproj +++ b/SafeExamBrowser.Core/SafeExamBrowser.Core.csproj @@ -58,7 +58,9 @@ - + + + @@ -82,6 +84,8 @@ SafeExamBrowser.Contracts - + + + \ No newline at end of file diff --git a/SafeExamBrowser.Runtime.UnitTests/Behaviour/Operations/ServiceOperationTests.cs b/SafeExamBrowser.Runtime.UnitTests/Behaviour/Operations/ServiceOperationTests.cs index 499af334..5601250f 100644 --- a/SafeExamBrowser.Runtime.UnitTests/Behaviour/Operations/ServiceOperationTests.cs +++ b/SafeExamBrowser.Runtime.UnitTests/Behaviour/Operations/ServiceOperationTests.cs @@ -6,17 +6,151 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +using System; using Microsoft.VisualStudio.TestTools.UnitTesting; +using Moq; +using SafeExamBrowser.Contracts.Communication; +using SafeExamBrowser.Contracts.Configuration.Settings; +using SafeExamBrowser.Contracts.I18n; +using SafeExamBrowser.Contracts.Logging; +using SafeExamBrowser.Contracts.UserInterface; +using SafeExamBrowser.Runtime.Behaviour.Operations; namespace SafeExamBrowser.Runtime.UnitTests.Behaviour.Operations { [TestClass] public class ServiceOperationTests { - [TestMethod] - public void Test() + private Mock logger; + private Mock service; + private Mock settings; + private Mock splashScreen; + private Mock text; + private ServiceOperation sut; + + [TestInitialize] + public void Initialize() { - Assert.Fail(); + logger = new Mock(); + service = new Mock(); + settings = new Mock(); + splashScreen = new Mock(); + text = new Mock(); + + sut = new ServiceOperation(logger.Object, service.Object, settings.Object, text.Object) + { + SplashScreen = splashScreen.Object + }; + } + + [TestMethod] + public void MustConnectToService() + { + service.Setup(s => s.Connect()).Returns(true); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Mandatory); + + sut.Perform(); + + service.Setup(s => s.Connect()).Returns(true); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Optional); + + sut.Perform(); + + service.Verify(s => s.Connect(), Times.Exactly(2)); + } + + [TestMethod] + public void MustNotFailIfServiceNotAvailable() + { + service.Setup(s => s.Connect()).Returns(false); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Mandatory); + + sut.Perform(); + + service.Setup(s => s.Connect()).Returns(false); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Optional); + + sut.Perform(); + + service.Setup(s => s.Connect()).Throws(); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Mandatory); + + sut.Perform(); + + service.Setup(s => s.Connect()).Throws(); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Optional); + + sut.Perform(); + } + + [TestMethod] + public void MustAbortIfServiceMandatoryAndNotAvailable() + { + service.Setup(s => s.Connect()).Returns(false); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Mandatory); + + sut.Perform(); + + Assert.IsTrue(sut.AbortStartup); + } + + [TestMethod] + public void MustNotAbortIfServiceOptionalAndNotAvailable() + { + service.Setup(s => s.Connect()).Returns(false); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Optional); + + sut.Perform(); + + Assert.IsFalse(sut.AbortStartup); + } + + [TestMethod] + public void MustDisconnectWhenReverting() + { + service.Setup(s => s.Connect()).Returns(true); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Mandatory); + + sut.Perform(); + sut.Revert(); + + service.Setup(s => s.Connect()).Returns(true); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Optional); + + sut.Perform(); + sut.Revert(); + + service.Verify(s => s.Disconnect(), Times.Exactly(2)); + } + + [TestMethod] + public void MustNotDisconnnectIfNotAvailable() + { + service.Setup(s => s.Connect()).Returns(false); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Mandatory); + + sut.Perform(); + sut.Revert(); + + service.Setup(s => s.Connect()).Returns(false); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Optional); + + sut.Perform(); + sut.Revert(); + + service.Setup(s => s.Connect()).Throws(); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Mandatory); + + sut.Perform(); + sut.Revert(); + + service.Setup(s => s.Connect()).Throws(); + settings.SetupGet(s => s.Current.ServicePolicy).Returns(ServicePolicy.Optional); + + sut.Perform(); + sut.Revert(); + + service.Verify(s => s.Disconnect(), Times.Never); } } } diff --git a/SafeExamBrowser.Runtime.UnitTests/Behaviour/RuntimeControllerTests.cs b/SafeExamBrowser.Runtime.UnitTests/Behaviour/RuntimeControllerTests.cs index 91bd5b3d..c0359d81 100644 --- a/SafeExamBrowser.Runtime.UnitTests/Behaviour/RuntimeControllerTests.cs +++ b/SafeExamBrowser.Runtime.UnitTests/Behaviour/RuntimeControllerTests.cs @@ -14,7 +14,7 @@ namespace SafeExamBrowser.Runtime.UnitTests.Behaviour public class RuntimeControllerTests { [TestMethod] - public void Test() + public void TODO() { Assert.Fail(); } diff --git a/SafeExamBrowser.Runtime/Behaviour/Operations/ServiceOperation.cs b/SafeExamBrowser.Runtime/Behaviour/Operations/ServiceOperation.cs index 531cc21f..84153154 100644 --- a/SafeExamBrowser.Runtime/Behaviour/Operations/ServiceOperation.cs +++ b/SafeExamBrowser.Runtime/Behaviour/Operations/ServiceOperation.cs @@ -6,9 +6,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +using System; using SafeExamBrowser.Contracts.Behaviour; using SafeExamBrowser.Contracts.Communication; using SafeExamBrowser.Contracts.Configuration.Settings; +using SafeExamBrowser.Contracts.I18n; using SafeExamBrowser.Contracts.Logging; using SafeExamBrowser.Contracts.UserInterface; @@ -16,31 +18,76 @@ namespace SafeExamBrowser.Runtime.Behaviour.Operations { internal class ServiceOperation : IOperation { - private ICommunicationHost serviceHost; + private bool serviceAvailable; + private bool serviceMandatory; private ILogger logger; + private IServiceProxy service; private ISettingsRepository settingsRepository; + private IText text; public bool AbortStartup { get; private set; } public ISplashScreen SplashScreen { private get; set; } - public ServiceOperation(ICommunicationHost serviceHost, ILogger logger, ISettingsRepository settingsRepository) + public ServiceOperation(ILogger logger, IServiceProxy service, ISettingsRepository settingsRepository, IText text) { - this.serviceHost = serviceHost; + this.service = service; this.logger = logger; this.settingsRepository = settingsRepository; + this.text = text; } public void Perform() { - logger.Info("Initializing service connection..."); - // SplashScreen.UpdateText(...) + logger.Info($"Initializing service connection..."); + SplashScreen.UpdateText(TextKey.SplashScreen_InitializeServiceConnection); - // TODO + try + { + serviceMandatory = settingsRepository.Current.ServicePolicy == ServicePolicy.Mandatory; + serviceAvailable = service.Connect(); + } + catch (Exception e) + { + var message = "Failed to connect to the service component!"; + + if (serviceMandatory) + { + logger.Error(message, e); + } + else + { + logger.Info($"{message} Reason: {e.Message}"); + } + } + + AbortStartup = serviceMandatory && !serviceAvailable; + + if (AbortStartup) + { + logger.Info("Aborting startup because the service is mandatory but not available!"); + } + else + { + logger.Info($"The service is {(serviceMandatory ? "mandatory" : "optional")} and {(!serviceAvailable ? "not" : "")} available."); + } } public void Revert() { - // TODO + logger.Info("Closing service connection..."); + SplashScreen.UpdateText(TextKey.SplashScreen_CloseServiceConnection); + + if (serviceAvailable) + { + try + { + service.Disconnect(); + } + catch (Exception e) + { + logger.Error("Failed to disconnect from service component!", e); + } + } } } } diff --git a/SafeExamBrowser.Runtime/Behaviour/RuntimeController.cs b/SafeExamBrowser.Runtime/Behaviour/RuntimeController.cs index f040316e..565dcb55 100644 --- a/SafeExamBrowser.Runtime/Behaviour/RuntimeController.cs +++ b/SafeExamBrowser.Runtime/Behaviour/RuntimeController.cs @@ -17,7 +17,7 @@ namespace SafeExamBrowser.Runtime.Behaviour { internal class RuntimeController : IRuntimeController { - private ICommunicationHost serviceProxy; + private ICommunication serviceProxy; private Queue operations; private ILogger logger; private ISettingsRepository settingsRepository; @@ -27,7 +27,7 @@ namespace SafeExamBrowser.Runtime.Behaviour public ISettings Settings { private get; set; } public RuntimeController( - ICommunicationHost serviceProxy, + ICommunication serviceProxy, ILogger logger, ISettingsRepository settingsRepository, IShutdownController shutdownController, diff --git a/SafeExamBrowser.Runtime/CompositionRoot.cs b/SafeExamBrowser.Runtime/CompositionRoot.cs index d667158b..4f30f348 100644 --- a/SafeExamBrowser.Runtime/CompositionRoot.cs +++ b/SafeExamBrowser.Runtime/CompositionRoot.cs @@ -51,7 +51,7 @@ namespace SafeExamBrowser.Runtime InitializeLogging(); var text = new Text(logger); - var serviceProxy = new CommunicationHostProxy(new ModuleLogger(logger, typeof(CommunicationHostProxy)), "net.pipe://localhost/safeexambrowser/service"); + var serviceProxy = new ServiceProxy(new ModuleLogger(logger, typeof(ServiceProxy)), "net.pipe://localhost/safeexambrowser/service"); var shutdownController = new ShutdownController(logger, runtimeInfo, text, uiFactory); var startupController = new StartupController(logger, runtimeInfo, systemInfo, text, uiFactory); @@ -60,7 +60,7 @@ namespace SafeExamBrowser.Runtime StartupOperations = new Queue(); StartupOperations.Enqueue(new I18nOperation(logger, text)); StartupOperations.Enqueue(new ConfigurationOperation(logger, runtimeInfo, settingsRepository, text, uiFactory, args)); - StartupOperations.Enqueue(new ServiceOperation(serviceProxy, logger, settingsRepository)); + StartupOperations.Enqueue(new ServiceOperation(logger, serviceProxy, settingsRepository, text)); //StartupOperations.Enqueue(new KioskModeOperation()); }