SEBWIN-342: Removed unnecessary dependency from system components on I18n.

This commit is contained in:
dbuechel 2019-09-04 12:07:32 +02:00
parent 6f51d266cc
commit 12f44edc0b
7 changed files with 24 additions and 33 deletions

View file

@ -45,7 +45,6 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
sut.Perform(); sut.Perform();
application.Verify(c => c.Initialize(), Times.Once); application.Verify(c => c.Initialize(), Times.Once);
// TODO controller.Verify(c => c.RegisterApplicationControl(It.IsAny<IApplicationControl>()), Times.Exactly(2));
actionCenter.Verify(a => a.AddApplicationControl(It.IsAny<IApplicationControl>()), Times.Once); actionCenter.Verify(a => a.AddApplicationControl(It.IsAny<IApplicationControl>()), Times.Once);
taskbar.Verify(t => t.AddApplicationControl(It.IsAny<IApplicationControl>()), Times.Once); taskbar.Verify(t => t.AddApplicationControl(It.IsAny<IApplicationControl>()), Times.Once);
} }

View file

@ -264,7 +264,7 @@ namespace SafeExamBrowser.Client
var logInfo = new LogNotificationInfo(text); var logInfo = new LogNotificationInfo(text);
var logController = new LogNotificationController(logger, uiFactory); var logController = new LogNotificationController(logger, uiFactory);
var powerSupply = new PowerSupply(new ModuleLogger(logger, nameof(PowerSupply))); var powerSupply = new PowerSupply(new ModuleLogger(logger, nameof(PowerSupply)));
var wirelessAdapter = new WirelessAdapter(new ModuleLogger(logger, nameof(WirelessAdapter)), text); var wirelessAdapter = new WirelessAdapter(new ModuleLogger(logger, nameof(WirelessAdapter)));
var activators = new IActionCenterActivator[] var activators = new IActionCenterActivator[]
{ {
new KeyboardActivator(new ModuleLogger(logger, nameof(KeyboardActivator))), new KeyboardActivator(new ModuleLogger(logger, nameof(KeyboardActivator))),

View file

@ -81,10 +81,6 @@
<Project>{7d74555e-63e1-4c46-bd0a-8580552368c8}</Project> <Project>{7d74555e-63e1-4c46-bd0a-8580552368c8}</Project>
<Name>SafeExamBrowser.Configuration.Contracts</Name> <Name>SafeExamBrowser.Configuration.Contracts</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\SafeExamBrowser.I18n.Contracts\SafeExamBrowser.I18n.Contracts.csproj">
<Project>{1858ddf3-bc2a-4bff-b663-4ce2ffeb8b7d}</Project>
<Name>SafeExamBrowser.I18n.Contracts</Name>
</ProjectReference>
<ProjectReference Include="..\SafeExamBrowser.Logging.Contracts\SafeExamBrowser.Logging.Contracts.csproj"> <ProjectReference Include="..\SafeExamBrowser.Logging.Contracts\SafeExamBrowser.Logging.Contracts.csproj">
<Project>{64ea30fb-11d4-436a-9c2b-88566285363e}</Project> <Project>{64ea30fb-11d4-436a-9c2b-88566285363e}</Project>
<Name>SafeExamBrowser.Logging.Contracts</Name> <Name>SafeExamBrowser.Logging.Contracts</Name>

View file

@ -10,7 +10,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Timers; using System.Timers;
using SafeExamBrowser.I18n.Contracts;
using SafeExamBrowser.Logging.Contracts; using SafeExamBrowser.Logging.Contracts;
using SafeExamBrowser.SystemComponents.Contracts.WirelessNetwork; using SafeExamBrowser.SystemComponents.Contracts.WirelessNetwork;
using SafeExamBrowser.SystemComponents.Contracts.WirelessNetwork.Events; using SafeExamBrowser.SystemComponents.Contracts.WirelessNetwork.Events;
@ -26,7 +25,6 @@ namespace SafeExamBrowser.SystemComponents.WirelessNetwork
private List<WirelessNetwork> networks; private List<WirelessNetwork> networks;
private ILogger logger; private ILogger logger;
private IText text;
private Timer timer; private Timer timer;
private Wifi wifi; private Wifi wifi;
@ -35,11 +33,10 @@ namespace SafeExamBrowser.SystemComponents.WirelessNetwork
public event NetworksChangedEventHandler NetworksChanged; public event NetworksChangedEventHandler NetworksChanged;
public event StatusChangedEventHandler StatusChanged; public event StatusChangedEventHandler StatusChanged;
public WirelessAdapter(ILogger logger, IText text) public WirelessAdapter(ILogger logger)
{ {
this.logger = logger; this.logger = logger;
this.networks = new List<WirelessNetwork>(); this.networks = new List<WirelessNetwork>();
this.text = text;
} }
public void Connect(Guid id) public void Connect(Guid id)

View file

@ -13,7 +13,6 @@ namespace SafeExamBrowser.UserInterface.Contracts.Shell
/// </summary> /// </summary>
public interface ISystemControl public interface ISystemControl
{ {
// TODO: Check if needed after all changes!
/// <summary> /// <summary>
/// Closes the control and / or any associated user interface elements. /// Closes the control and / or any associated user interface elements.
/// </summary> /// </summary>

View file

@ -125,19 +125,19 @@ namespace SafeExamBrowser.UserInterface.Desktop
private void Taskbar_Closing(object sender, CancelEventArgs e) private void Taskbar_Closing(object sender, CancelEventArgs e)
{ {
if (!allowClose) if (allowClose)
{
foreach (var child in SystemControlStackPanel.Children)
{
if (child is ISystemControl systemControl)
{
systemControl.Close();
}
}
}
else
{ {
e.Cancel = true; e.Cancel = true;
return;
}
foreach (var child in SystemControlStackPanel.Children)
{
if (child is ISystemControl systemControl)
{
systemControl.Close();
}
} }
} }

View file

@ -125,19 +125,19 @@ namespace SafeExamBrowser.UserInterface.Mobile
private void Taskbar_Closing(object sender, CancelEventArgs e) private void Taskbar_Closing(object sender, CancelEventArgs e)
{ {
if (!allowClose) if (allowClose)
{
foreach (var child in SystemControlStackPanel.Children)
{
if (child is ISystemControl systemControl)
{
systemControl.Close();
}
}
}
else
{ {
e.Cancel = true; e.Cancel = true;
return;
}
foreach (var child in SystemControlStackPanel.Children)
{
if (child is ISystemControl systemControl)
{
systemControl.Close();
}
} }
} }