diff --git a/SafeExamBrowser.Browser/BrowserApplicationController.cs b/SafeExamBrowser.Browser/BrowserApplicationController.cs index 950108be..6613ddca 100644 --- a/SafeExamBrowser.Browser/BrowserApplicationController.cs +++ b/SafeExamBrowser.Browser/BrowserApplicationController.cs @@ -45,7 +45,9 @@ namespace SafeExamBrowser.Browser var cefSettings = new CefSettings { CachePath = runtimeInfo.BrowserCachePath, - LogFile = runtimeInfo.BrowserLogFile + LogFile = runtimeInfo.BrowserLogFile, + // TODO: Set according to current application LogLevel! + LogSeverity = LogSeverity.Verbose }; var success = Cef.Initialize(cefSettings, true, null); diff --git a/SafeExamBrowser.Client.UnitTests/Behaviour/Operations/TaskbarOperationTests.cs b/SafeExamBrowser.Client.UnitTests/Behaviour/Operations/TaskbarOperationTests.cs index 4db84267..981fca16 100644 --- a/SafeExamBrowser.Client.UnitTests/Behaviour/Operations/TaskbarOperationTests.cs +++ b/SafeExamBrowser.Client.UnitTests/Behaviour/Operations/TaskbarOperationTests.cs @@ -9,6 +9,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using SafeExamBrowser.Client.Behaviour.Operations; +using SafeExamBrowser.Contracts.Behaviour; using SafeExamBrowser.Contracts.Configuration; using SafeExamBrowser.Contracts.Configuration.Settings; using SafeExamBrowser.Contracts.I18n; @@ -24,6 +25,8 @@ namespace SafeExamBrowser.Client.UnitTests.Behaviour.Operations { private Mock loggerMock; private TaskbarSettings settings; + private Mock logInfoMock; + private Mock logControllerMock; private Mock> keyboardLayoutMock; private Mock> powerSupplyMock; private Mock> wirelessNetworkMock; @@ -38,12 +41,14 @@ namespace SafeExamBrowser.Client.UnitTests.Behaviour.Operations public void Initialize() { loggerMock = new Mock(); - settings = new TaskbarSettings(); + logInfoMock = new Mock(); + logControllerMock = new Mock(); keyboardLayoutMock = new Mock>(); powerSupplyMock = new Mock>(); wirelessNetworkMock = new Mock>(); systemInfoMock = new Mock(); taskbarMock = new Mock(); + settings = new TaskbarSettings(); textMock = new Mock(); uiFactoryMock = new Mock(); @@ -55,12 +60,14 @@ namespace SafeExamBrowser.Client.UnitTests.Behaviour.Operations sut = new TaskbarOperation( loggerMock.Object, - settings, + logInfoMock.Object, + logControllerMock.Object, keyboardLayoutMock.Object, powerSupplyMock.Object, wirelessNetworkMock.Object, systemInfoMock.Object, taskbarMock.Object, + settings, textMock.Object, uiFactoryMock.Object); } diff --git a/SafeExamBrowser.Client/Behaviour/Operations/ProcessMonitorOperation.cs b/SafeExamBrowser.Client/Behaviour/Operations/ProcessMonitorOperation.cs index cb967e94..0e2a0fb9 100644 --- a/SafeExamBrowser.Client/Behaviour/Operations/ProcessMonitorOperation.cs +++ b/SafeExamBrowser.Client/Behaviour/Operations/ProcessMonitorOperation.cs @@ -38,7 +38,7 @@ namespace SafeExamBrowser.Client.Behaviour.Operations ProgressIndicator?.UpdateText(TextKey.ProgressIndicator_InitializeProcessMonitoring); - // TODO + // TODO: Implement process monitoring... } public void Repeat() @@ -51,7 +51,7 @@ namespace SafeExamBrowser.Client.Behaviour.Operations logger.Info("Stopping process monitoring..."); ProgressIndicator?.UpdateText(TextKey.ProgressIndicator_StopProcessMonitoring); - // TODO + // TODO: Implement process monitoring... ProgressIndicator?.UpdateText(TextKey.ProgressIndicator_WaitExplorerStartup, true); diff --git a/SafeExamBrowser.Client/Behaviour/Operations/TaskbarOperation.cs b/SafeExamBrowser.Client/Behaviour/Operations/TaskbarOperation.cs index 8eb65183..32f37644 100644 --- a/SafeExamBrowser.Client/Behaviour/Operations/TaskbarOperation.cs +++ b/SafeExamBrowser.Client/Behaviour/Operations/TaskbarOperation.cs @@ -6,7 +6,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -using SafeExamBrowser.Client.Notifications; using SafeExamBrowser.Contracts.Behaviour; using SafeExamBrowser.Contracts.Behaviour.Operations; using SafeExamBrowser.Contracts.Configuration; @@ -22,6 +21,7 @@ namespace SafeExamBrowser.Client.Behaviour.Operations internal class TaskbarOperation : IOperation { private ILogger logger; + private INotificationInfo logInfo; private INotificationController logController; private TaskbarSettings settings; private ISystemComponent keyboardLayout; @@ -37,19 +37,23 @@ namespace SafeExamBrowser.Client.Behaviour.Operations public TaskbarOperation( ILogger logger, - TaskbarSettings settings, + INotificationInfo logInfo, + INotificationController logController, ISystemComponent keyboardLayout, ISystemComponent powerSupply, ISystemComponent wirelessNetwork, ISystemInfo systemInfo, ITaskbar taskbar, + TaskbarSettings settings, IText text, IUserInterfaceFactory uiFactory) { this.logger = logger; - this.settings = settings; + this.logInfo = logInfo; + this.logController = logController; this.keyboardLayout = keyboardLayout; this.powerSupply = powerSupply; + this.settings = settings; this.systemInfo = systemInfo; this.taskbar = taskbar; this.text = text; @@ -95,7 +99,7 @@ namespace SafeExamBrowser.Client.Behaviour.Operations if (settings.AllowApplicationLog) { - logController?.Terminate(); + logController.Terminate(); } if (settings.AllowKeyboardLayout) @@ -140,13 +144,9 @@ namespace SafeExamBrowser.Client.Behaviour.Operations private void CreateLogNotification() { - // TODO: Resolve dependencies -> CompositionRoot! - var logInfo = new LogNotificationInfo(text); var logNotification = uiFactory.CreateNotification(logInfo); - - logController = new LogNotificationController(logger, uiFactory); + logController.RegisterNotification(logNotification); - taskbar.AddNotification(logNotification); } } diff --git a/SafeExamBrowser.Client/CompositionRoot.cs b/SafeExamBrowser.Client/CompositionRoot.cs index 2e698300..6a2d62b5 100644 --- a/SafeExamBrowser.Client/CompositionRoot.cs +++ b/SafeExamBrowser.Client/CompositionRoot.cs @@ -13,6 +13,7 @@ using SafeExamBrowser.Browser; using SafeExamBrowser.Client.Behaviour; using SafeExamBrowser.Client.Behaviour.Operations; using SafeExamBrowser.Client.Communication; +using SafeExamBrowser.Client.Notifications; using SafeExamBrowser.Configuration; using SafeExamBrowser.Contracts.Behaviour; using SafeExamBrowser.Contracts.Behaviour.Operations; @@ -180,9 +181,11 @@ namespace SafeExamBrowser.Client private IOperation BuildTaskbarOperation() { var keyboardLayout = new KeyboardLayout(new ModuleLogger(logger, typeof(KeyboardLayout)), text); + var logController = new LogNotificationController(logger, uiFactory); + var logInfo = new LogNotificationInfo(text); var powerSupply = new PowerSupply(new ModuleLogger(logger, typeof(PowerSupply)), text); var wirelessNetwork = new WirelessNetwork(new ModuleLogger(logger, typeof(WirelessNetwork)), text); - var operation = new TaskbarOperation(logger, configuration.Settings.Taskbar, keyboardLayout, powerSupply, wirelessNetwork, systemInfo, Taskbar, text, uiFactory); + var operation = new TaskbarOperation(logger, logInfo, logController, keyboardLayout, powerSupply, wirelessNetwork, systemInfo, Taskbar, configuration.Settings.Taskbar, text, uiFactory); return operation; } diff --git a/SafeExamBrowser.Configuration/ConfigurationRepository.cs b/SafeExamBrowser.Configuration/ConfigurationRepository.cs index bcc23def..d3cdca07 100644 --- a/SafeExamBrowser.Configuration/ConfigurationRepository.cs +++ b/SafeExamBrowser.Configuration/ConfigurationRepository.cs @@ -59,7 +59,7 @@ namespace SafeExamBrowser.Configuration public Settings LoadSettings(Uri path) { - // TODO + // TODO: Implement loading mechanism return LoadDefaultSettings(); } @@ -68,7 +68,7 @@ namespace SafeExamBrowser.Configuration { var settings = new Settings() { - // TODO + // TODO: Implement default settings ServicePolicy = ServicePolicy.Optional }; diff --git a/SafeExamBrowser.Contracts/Behaviour/IClientController.cs b/SafeExamBrowser.Contracts/Behaviour/IClientController.cs index 878a5db0..f2d6b5a4 100644 --- a/SafeExamBrowser.Contracts/Behaviour/IClientController.cs +++ b/SafeExamBrowser.Contracts/Behaviour/IClientController.cs @@ -13,7 +13,6 @@ using SafeExamBrowser.Contracts.Configuration.Settings; namespace SafeExamBrowser.Contracts.Behaviour { - // TODO: Interface really needed?! public interface IClientController { /// diff --git a/SafeExamBrowser.Contracts/Behaviour/IRuntimeController.cs b/SafeExamBrowser.Contracts/Behaviour/IRuntimeController.cs index 68a571cb..e40a3518 100644 --- a/SafeExamBrowser.Contracts/Behaviour/IRuntimeController.cs +++ b/SafeExamBrowser.Contracts/Behaviour/IRuntimeController.cs @@ -8,7 +8,6 @@ namespace SafeExamBrowser.Contracts.Behaviour { - // TODO: Interface really needed?! public interface IRuntimeController { /// diff --git a/SafeExamBrowser.Core/Communication/ServiceProxy.cs b/SafeExamBrowser.Core/Communication/ServiceProxy.cs index 74140c99..4fae2426 100644 --- a/SafeExamBrowser.Core/Communication/ServiceProxy.cs +++ b/SafeExamBrowser.Core/Communication/ServiceProxy.cs @@ -48,7 +48,8 @@ namespace SafeExamBrowser.Core.Communication return; } - // TODO: Send(new StartSessionMessage { Id = sessionId, Settings = settings }); + // TODO: Implement service communication + // Send(new StartSessionMessage { Id = sessionId, Settings = settings }); } public void StopSession(Guid sessionId) @@ -58,7 +59,8 @@ namespace SafeExamBrowser.Core.Communication return; } - // TODO: Send(new StopSessionMessage { SessionId = sessionId }); + // TODO: Implement service communication + // Send(new StopSessionMessage { SessionId = sessionId }); } private bool IgnoreOperation(string operationName) diff --git a/SafeExamBrowser.Runtime/Behaviour/Operations/KioskModeOperation.cs b/SafeExamBrowser.Runtime/Behaviour/Operations/KioskModeOperation.cs index 5b038120..17087503 100644 --- a/SafeExamBrowser.Runtime/Behaviour/Operations/KioskModeOperation.cs +++ b/SafeExamBrowser.Runtime/Behaviour/Operations/KioskModeOperation.cs @@ -50,7 +50,7 @@ namespace SafeExamBrowser.Runtime.Behaviour.Operations public void Repeat() { - // TODO + // TODO: Depends on new kiosk mode! } public void Revert() diff --git a/SafeExamBrowser.Runtime/Behaviour/Operations/ServiceConnectionOperation.cs b/SafeExamBrowser.Runtime/Behaviour/Operations/ServiceConnectionOperation.cs index 58e58694..84a84ce8 100644 --- a/SafeExamBrowser.Runtime/Behaviour/Operations/ServiceConnectionOperation.cs +++ b/SafeExamBrowser.Runtime/Behaviour/Operations/ServiceConnectionOperation.cs @@ -65,7 +65,7 @@ namespace SafeExamBrowser.Runtime.Behaviour.Operations public void Repeat() { - // TODO + // TODO: Re-check if mandatory, if so, try to connect (if not connected) - otherwise, no action required (except maybe logging of status?) } public void Revert() diff --git a/SafeExamBrowser.WindowsApi/Desktop.cs b/SafeExamBrowser.WindowsApi/Desktop.cs index e09b40d0..d54333db 100644 --- a/SafeExamBrowser.WindowsApi/Desktop.cs +++ b/SafeExamBrowser.WindowsApi/Desktop.cs @@ -15,7 +15,7 @@ namespace SafeExamBrowser.WindowsApi { private ILogger logger; - // TODO! + // TODO: Implement desktop functionality! public string CurrentName => "Default"; public Desktop(ILogger logger) diff --git a/SafeExamBrowser.WindowsApi/ProcessFactory.cs b/SafeExamBrowser.WindowsApi/ProcessFactory.cs index d339b237..8e7dea7b 100644 --- a/SafeExamBrowser.WindowsApi/ProcessFactory.cs +++ b/SafeExamBrowser.WindowsApi/ProcessFactory.cs @@ -34,7 +34,7 @@ namespace SafeExamBrowser.WindowsApi var startupInfo = new STARTUPINFO(); startupInfo.cb = Marshal.SizeOf(startupInfo); - // TODO: + // TODO: Specify target desktop! //startupInfo.lpDesktop = desktop.CurrentName; var success = Kernel32.CreateProcess(null, commandLine, IntPtr.Zero, IntPtr.Zero, true, Constant.NORMAL_PRIORITY_CLASS, IntPtr.Zero, null, ref startupInfo, ref processInfo);