SEBWIN-836: Grouped all settings related to the user interface.

This commit is contained in:
Damian Büchel 2024-06-12 18:18:52 +02:00
parent 05f46cd6b4
commit 0fb7f23bcb
15 changed files with 137 additions and 139 deletions

View file

@ -156,7 +156,7 @@ namespace SafeExamBrowser.Client.UnitTests
var shell = 0; var shell = 0;
var workingArea = 0; var workingArea = 0;
settings.Taskbar.EnableTaskbar = true; settings.UserInterface.Taskbar.EnableTaskbar = true;
actionCenter.Setup(a => a.InitializeBounds()).Callback(() => boundsActionCenter = ++order); actionCenter.Setup(a => a.InitializeBounds()).Callback(() => boundsActionCenter = ++order);
explorerShell.Setup(e => e.Terminate()).Callback(() => shell = ++order); explorerShell.Setup(e => e.Terminate()).Callback(() => shell = ++order);
@ -190,7 +190,7 @@ namespace SafeExamBrowser.Client.UnitTests
var shell = 0; var shell = 0;
var workingArea = 0; var workingArea = 0;
settings.Taskbar.EnableTaskbar = false; settings.UserInterface.Taskbar.EnableTaskbar = false;
actionCenter.Setup(a => a.InitializeBounds()).Callback(() => boundsActionCenter = ++order); actionCenter.Setup(a => a.InitializeBounds()).Callback(() => boundsActionCenter = ++order);
explorerShell.Setup(e => e.Terminate()).Callback(() => shell = ++order); explorerShell.Setup(e => e.Terminate()).Callback(() => shell = ++order);
@ -502,7 +502,7 @@ namespace SafeExamBrowser.Client.UnitTests
var order = 0; var order = 0;
var workingArea = 0; var workingArea = 0;
settings.Taskbar.EnableTaskbar = true; settings.UserInterface.Taskbar.EnableTaskbar = true;
actionCenter.Setup(t => t.InitializeBounds()).Callback(() => boundsActionCenter = ++order); actionCenter.Setup(t => t.InitializeBounds()).Callback(() => boundsActionCenter = ++order);
displayMonitor.Setup(m => m.InitializePrimaryDisplay(It.Is<int>(h => h == height))).Callback(() => workingArea = ++order); displayMonitor.Setup(m => m.InitializePrimaryDisplay(It.Is<int>(h => h == height))).Callback(() => workingArea = ++order);
@ -533,7 +533,7 @@ namespace SafeExamBrowser.Client.UnitTests
var order = 0; var order = 0;
var workingArea = 0; var workingArea = 0;
settings.Taskbar.EnableTaskbar = false; settings.UserInterface.Taskbar.EnableTaskbar = false;
actionCenter.Setup(t => t.InitializeBounds()).Callback(() => boundsActionCenter = ++order); actionCenter.Setup(t => t.InitializeBounds()).Callback(() => boundsActionCenter = ++order);
displayMonitor.Setup(w => w.InitializePrimaryDisplay(It.Is<int>(h => h == 0))).Callback(() => workingArea = ++order); displayMonitor.Setup(w => w.InitializePrimaryDisplay(It.Is<int>(h => h == 0))).Callback(() => workingArea = ++order);
@ -949,8 +949,8 @@ namespace SafeExamBrowser.Client.UnitTests
[TestMethod] [TestMethod]
public void Shutdown_MustCloseActionCenterAndTaskbarIfEnabled() public void Shutdown_MustCloseActionCenterAndTaskbarIfEnabled()
{ {
settings.ActionCenter.EnableActionCenter = true; settings.UserInterface.ActionCenter.EnableActionCenter = true;
settings.Taskbar.EnableTaskbar = true; settings.UserInterface.Taskbar.EnableTaskbar = true;
sut.Terminate(); sut.Terminate();
@ -961,8 +961,8 @@ namespace SafeExamBrowser.Client.UnitTests
[TestMethod] [TestMethod]
public void Shutdown_MustNotCloseActionCenterAndTaskbarIfNotEnabled() public void Shutdown_MustNotCloseActionCenterAndTaskbarIfNotEnabled()
{ {
settings.ActionCenter.EnableActionCenter = false; settings.UserInterface.ActionCenter.EnableActionCenter = false;
settings.Taskbar.EnableTaskbar = false; settings.UserInterface.Taskbar.EnableTaskbar = false;
sut.Terminate(); sut.Terminate();
@ -1133,7 +1133,7 @@ namespace SafeExamBrowser.Client.UnitTests
[TestMethod] [TestMethod]
public void Startup_MustCorrectlyShowTaskbar() public void Startup_MustCorrectlyShowTaskbar()
{ {
settings.Taskbar.EnableTaskbar = true; settings.UserInterface.Taskbar.EnableTaskbar = true;
sut.TryStart(); sut.TryStart();
taskbar.Verify(t => t.Show(), Times.Once); taskbar.Verify(t => t.Show(), Times.Once);
@ -1145,7 +1145,7 @@ namespace SafeExamBrowser.Client.UnitTests
taskbar.Verify(t => t.Show(), Times.Never); taskbar.Verify(t => t.Show(), Times.Never);
taskbar.Reset(); taskbar.Reset();
settings.Taskbar.EnableTaskbar = false; settings.UserInterface.Taskbar.EnableTaskbar = false;
operationSequence.Setup(o => o.TryPerform()).Returns(OperationResult.Success); operationSequence.Setup(o => o.TryPerform()).Returns(OperationResult.Success);
sut.TryStart(); sut.TryStart();
@ -1155,7 +1155,7 @@ namespace SafeExamBrowser.Client.UnitTests
[TestMethod] [TestMethod]
public void Startup_MustCorrectlyShowActionCenter() public void Startup_MustCorrectlyShowActionCenter()
{ {
settings.ActionCenter.EnableActionCenter = true; settings.UserInterface.ActionCenter.EnableActionCenter = true;
sut.TryStart(); sut.TryStart();
actionCenter.Verify(t => t.Promote(), Times.Once); actionCenter.Verify(t => t.Promote(), Times.Once);
@ -1169,7 +1169,7 @@ namespace SafeExamBrowser.Client.UnitTests
actionCenter.Verify(t => t.Show(), Times.Never); actionCenter.Verify(t => t.Show(), Times.Never);
actionCenter.Reset(); actionCenter.Reset();
settings.ActionCenter.EnableActionCenter = false; settings.UserInterface.ActionCenter.EnableActionCenter = false;
operationSequence.Setup(o => o.TryPerform()).Returns(OperationResult.Success); operationSequence.Setup(o => o.TryPerform()).Returns(OperationResult.Success);
sut.TryStart(); sut.TryStart();

View file

@ -64,9 +64,9 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
[TestMethod] [TestMethod]
public void Perform_MustNotInitializeBrowserIfNotEnabled() public void Perform_MustNotInitializeBrowserIfNotEnabled()
{ {
settings.ActionCenter.EnableActionCenter = true;
settings.Browser.EnableBrowser = false; settings.Browser.EnableBrowser = false;
settings.Taskbar.EnableTaskbar = true; settings.UserInterface.ActionCenter.EnableActionCenter = true;
settings.UserInterface.Taskbar.EnableTaskbar = true;
sut.Perform(); sut.Perform();
@ -79,17 +79,17 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
[TestMethod] [TestMethod]
public void Perform_MustCorrectlyInitializeControls() public void Perform_MustCorrectlyInitializeControls()
{ {
settings.ActionCenter.EnableActionCenter = false;
settings.Browser.EnableBrowser = true; settings.Browser.EnableBrowser = true;
settings.Taskbar.EnableTaskbar = false; settings.UserInterface.ActionCenter.EnableActionCenter = false;
settings.UserInterface.Taskbar.EnableTaskbar = false;
sut.Perform(); sut.Perform();
actionCenter.Verify(a => a.AddApplicationControl(It.IsAny<IApplicationControl>(), true), Times.Never); actionCenter.Verify(a => a.AddApplicationControl(It.IsAny<IApplicationControl>(), true), Times.Never);
taskbar.Verify(t => t.AddApplicationControl(It.IsAny<IApplicationControl>(), true), Times.Never); taskbar.Verify(t => t.AddApplicationControl(It.IsAny<IApplicationControl>(), true), Times.Never);
settings.ActionCenter.EnableActionCenter = true; settings.UserInterface.ActionCenter.EnableActionCenter = true;
settings.Taskbar.EnableTaskbar = true; settings.UserInterface.Taskbar.EnableTaskbar = true;
sut.Perform(); sut.Perform();

View file

@ -43,7 +43,7 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
var order = 0; var order = 0;
context.Settings = new AppSettings(); context.Settings = new AppSettings();
context.Settings.Taskbar.EnableTaskbar = true; context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
displayMonitor.Setup(d => d.InitializePrimaryDisplay(It.IsAny<int>())).Callback(() => Assert.AreEqual(++order, 1)); displayMonitor.Setup(d => d.InitializePrimaryDisplay(It.IsAny<int>())).Callback(() => Assert.AreEqual(++order, 1));
displayMonitor.Setup(d => d.StartMonitoringDisplayChanges()).Callback(() => Assert.AreEqual(++order, 2)); displayMonitor.Setup(d => d.StartMonitoringDisplayChanges()).Callback(() => Assert.AreEqual(++order, 2));
@ -60,7 +60,7 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
var height = 25; var height = 25;
context.Settings = new AppSettings(); context.Settings = new AppSettings();
context.Settings.Taskbar.EnableTaskbar = true; context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
taskbar.Setup(t => t.GetAbsoluteHeight()).Returns(height); taskbar.Setup(t => t.GetAbsoluteHeight()).Returns(height);
sut.Perform(); sut.Perform();
@ -75,7 +75,7 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
var height = 25; var height = 25;
context.Settings = new AppSettings(); context.Settings = new AppSettings();
context.Settings.Taskbar.EnableTaskbar = false; context.Settings.UserInterface.Taskbar.EnableTaskbar = false;
taskbar.Setup(t => t.GetAbsoluteHeight()).Returns(height); taskbar.Setup(t => t.GetAbsoluteHeight()).Returns(height);
sut.Perform(); sut.Perform();

View file

@ -100,9 +100,9 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
context.Activators.Add(actionCenterActivator.Object); context.Activators.Add(actionCenterActivator.Object);
context.Activators.Add(taskviewActivator.Object); context.Activators.Add(taskviewActivator.Object);
context.Activators.Add(terminationActivator.Object); context.Activators.Add(terminationActivator.Object);
context.Settings.ActionCenter.EnableActionCenter = true;
context.Settings.Keyboard.AllowAltTab = true; context.Settings.Keyboard.AllowAltTab = true;
context.Settings.Security.AllowTermination = true; context.Settings.Security.AllowTermination = true;
context.Settings.UserInterface.ActionCenter.EnableActionCenter = true;
sut.Perform(); sut.Perform();
@ -130,11 +130,11 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
context.Applications.Add(application1.Object); context.Applications.Add(application1.Object);
context.Applications.Add(application2.Object); context.Applications.Add(application2.Object);
context.Applications.Add(application3.Object); context.Applications.Add(application3.Object);
context.Settings.ActionCenter.EnableActionCenter = true;
context.Settings.Taskbar.EnableTaskbar = true;
context.Settings.Applications.Whitelist.Add(application1Settings); context.Settings.Applications.Whitelist.Add(application1Settings);
context.Settings.Applications.Whitelist.Add(application2Settings); context.Settings.Applications.Whitelist.Add(application2Settings);
context.Settings.Applications.Whitelist.Add(application3Settings); context.Settings.Applications.Whitelist.Add(application3Settings);
context.Settings.UserInterface.ActionCenter.EnableActionCenter = true;
context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
sut.Perform(); sut.Perform();
@ -168,11 +168,11 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
context.Applications.Add(application1.Object); context.Applications.Add(application1.Object);
context.Applications.Add(application2.Object); context.Applications.Add(application2.Object);
context.Applications.Add(application3.Object); context.Applications.Add(application3.Object);
context.Settings.ActionCenter.EnableActionCenter = false;
context.Settings.Taskbar.EnableTaskbar = false;
context.Settings.Applications.Whitelist.Add(application1Settings); context.Settings.Applications.Whitelist.Add(application1Settings);
context.Settings.Applications.Whitelist.Add(application2Settings); context.Settings.Applications.Whitelist.Add(application2Settings);
context.Settings.Applications.Whitelist.Add(application3Settings); context.Settings.Applications.Whitelist.Add(application3Settings);
context.Settings.UserInterface.ActionCenter.EnableActionCenter = false;
context.Settings.UserInterface.Taskbar.EnableTaskbar = false;
sut.Perform(); sut.Perform();
@ -211,10 +211,10 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
[TestMethod] [TestMethod]
public void Perform_MustInitializeClock() public void Perform_MustInitializeClock()
{ {
context.Settings.ActionCenter.EnableActionCenter = true; context.Settings.UserInterface.ActionCenter.EnableActionCenter = true;
context.Settings.ActionCenter.ShowClock = true; context.Settings.UserInterface.ActionCenter.ShowClock = true;
context.Settings.Taskbar.EnableTaskbar = true; context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
context.Settings.Taskbar.ShowClock = true; context.Settings.UserInterface.Taskbar.ShowClock = true;
sut.Perform(); sut.Perform();
@ -225,10 +225,10 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
[TestMethod] [TestMethod]
public void Perform_MustNotInitializeClock() public void Perform_MustNotInitializeClock()
{ {
context.Settings.ActionCenter.EnableActionCenter = true; context.Settings.UserInterface.ActionCenter.EnableActionCenter = true;
context.Settings.ActionCenter.ShowClock = false; context.Settings.UserInterface.ActionCenter.ShowClock = false;
context.Settings.Taskbar.EnableTaskbar = true; context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
context.Settings.Taskbar.ShowClock = false; context.Settings.UserInterface.Taskbar.ShowClock = false;
sut.Perform(); sut.Perform();
@ -239,9 +239,9 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
[TestMethod] [TestMethod]
public void Perform_MustInitializeQuitButton() public void Perform_MustInitializeQuitButton()
{ {
context.Settings.ActionCenter.EnableActionCenter = true;
context.Settings.Taskbar.EnableTaskbar = true;
context.Settings.Security.AllowTermination = false; context.Settings.Security.AllowTermination = false;
context.Settings.UserInterface.ActionCenter.EnableActionCenter = true;
context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
sut.Perform(); sut.Perform();
@ -265,12 +265,12 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
[TestMethod] [TestMethod]
public void Perform_MustInitializeNotifications() public void Perform_MustInitializeNotifications()
{ {
context.Settings.ActionCenter.EnableActionCenter = true; context.Settings.UserInterface.ActionCenter.EnableActionCenter = true;
context.Settings.ActionCenter.ShowApplicationInfo = true; context.Settings.UserInterface.ActionCenter.ShowApplicationInfo = true;
context.Settings.ActionCenter.ShowApplicationLog = true; context.Settings.UserInterface.ActionCenter.ShowApplicationLog = true;
context.Settings.Taskbar.EnableTaskbar = true; context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
context.Settings.Taskbar.ShowApplicationInfo = true; context.Settings.UserInterface.Taskbar.ShowApplicationInfo = true;
context.Settings.Taskbar.ShowApplicationLog = true; context.Settings.UserInterface.Taskbar.ShowApplicationLog = true;
sut.Perform(); sut.Perform();
@ -283,10 +283,10 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
{ {
var logControl = new Mock<INotificationControl>(); var logControl = new Mock<INotificationControl>();
context.Settings.ActionCenter.EnableActionCenter = true; context.Settings.UserInterface.ActionCenter.EnableActionCenter = true;
context.Settings.ActionCenter.ShowApplicationLog = false; context.Settings.UserInterface.ActionCenter.ShowApplicationLog = false;
context.Settings.Taskbar.EnableTaskbar = true; context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
context.Settings.Taskbar.ShowApplicationLog = false; context.Settings.UserInterface.Taskbar.ShowApplicationLog = false;
uiFactory uiFactory
.Setup(f => f.CreateNotificationControl(It.IsAny<INotification>(), It.IsAny<Location>())) .Setup(f => f.CreateNotificationControl(It.IsAny<INotification>(), It.IsAny<Location>()))
@ -301,14 +301,14 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
[TestMethod] [TestMethod]
public void Perform_MustInitializeSystemComponents() public void Perform_MustInitializeSystemComponents()
{ {
context.Settings.ActionCenter.EnableActionCenter = true; context.Settings.UserInterface.ActionCenter.EnableActionCenter = true;
context.Settings.ActionCenter.ShowAudio = true; context.Settings.UserInterface.ActionCenter.ShowAudio = true;
context.Settings.ActionCenter.ShowKeyboardLayout = true; context.Settings.UserInterface.ActionCenter.ShowKeyboardLayout = true;
context.Settings.ActionCenter.ShowNetwork = true; context.Settings.UserInterface.ActionCenter.ShowNetwork = true;
context.Settings.Taskbar.EnableTaskbar = true; context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
context.Settings.Taskbar.ShowAudio = true; context.Settings.UserInterface.Taskbar.ShowAudio = true;
context.Settings.Taskbar.ShowKeyboardLayout = true; context.Settings.UserInterface.Taskbar.ShowKeyboardLayout = true;
context.Settings.Taskbar.ShowNetwork = true; context.Settings.UserInterface.Taskbar.ShowNetwork = true;
systemInfo.SetupGet(s => s.HasBattery).Returns(true); systemInfo.SetupGet(s => s.HasBattery).Returns(true);
uiFactory.Setup(f => f.CreateAudioControl(It.IsAny<IAudio>(), It.IsAny<Location>())).Returns(new Mock<ISystemControl>().Object); uiFactory.Setup(f => f.CreateAudioControl(It.IsAny<IAudio>(), It.IsAny<Location>())).Returns(new Mock<ISystemControl>().Object);
@ -329,14 +329,14 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
[TestMethod] [TestMethod]
public void Perform_MustNotInitializeSystemComponents() public void Perform_MustNotInitializeSystemComponents()
{ {
context.Settings.ActionCenter.EnableActionCenter = true; context.Settings.UserInterface.ActionCenter.EnableActionCenter = true;
context.Settings.ActionCenter.ShowAudio = false; context.Settings.UserInterface.ActionCenter.ShowAudio = false;
context.Settings.ActionCenter.ShowKeyboardLayout = false; context.Settings.UserInterface.ActionCenter.ShowKeyboardLayout = false;
context.Settings.ActionCenter.ShowNetwork = false; context.Settings.UserInterface.ActionCenter.ShowNetwork = false;
context.Settings.Taskbar.EnableTaskbar = true; context.Settings.UserInterface.Taskbar.EnableTaskbar = true;
context.Settings.Taskbar.ShowAudio = false; context.Settings.UserInterface.Taskbar.ShowAudio = false;
context.Settings.Taskbar.ShowKeyboardLayout = false; context.Settings.UserInterface.Taskbar.ShowKeyboardLayout = false;
context.Settings.Taskbar.ShowNetwork = false; context.Settings.UserInterface.Taskbar.ShowNetwork = false;
systemInfo.SetupGet(s => s.HasBattery).Returns(false); systemInfo.SetupGet(s => s.HasBattery).Returns(false);
uiFactory.Setup(f => f.CreateAudioControl(It.IsAny<IAudio>(), It.IsAny<Location>())).Returns(new Mock<ISystemControl>().Object); uiFactory.Setup(f => f.CreateAudioControl(It.IsAny<IAudio>(), It.IsAny<Location>())).Returns(new Mock<ISystemControl>().Object);
@ -360,7 +360,7 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
var actionCenterActivator = new Mock<IActionCenterActivator>(); var actionCenterActivator = new Mock<IActionCenterActivator>();
context.Activators.Add(actionCenterActivator.Object); context.Activators.Add(actionCenterActivator.Object);
context.Settings.ActionCenter.EnableActionCenter = false; context.Settings.UserInterface.ActionCenter.EnableActionCenter = false;
sut.Perform(); sut.Perform();
@ -385,7 +385,7 @@ namespace SafeExamBrowser.Client.UnitTests.Operations
[TestMethod] [TestMethod]
public void Perform_MustNotInitializeTaskbarIfNotEnabled() public void Perform_MustNotInitializeTaskbarIfNotEnabled()
{ {
context.Settings.Taskbar.EnableTaskbar = false; context.Settings.UserInterface.Taskbar.EnableTaskbar = false;
sut.Perform(); sut.Perform();
taskbar.VerifyNoOtherCalls(); taskbar.VerifyNoOtherCalls();
} }

View file

@ -285,12 +285,12 @@ namespace SafeExamBrowser.Client
private void CloseShell() private void CloseShell()
{ {
if (Settings?.ActionCenter.EnableActionCenter == true) if (Settings?.UserInterface.ActionCenter.EnableActionCenter == true)
{ {
actionCenter.Close(); actionCenter.Close();
} }
if (Settings?.Taskbar.EnableTaskbar == true) if (Settings?.UserInterface.Taskbar.EnableTaskbar == true)
{ {
taskbar.Close(); taskbar.Close();
} }
@ -298,12 +298,12 @@ namespace SafeExamBrowser.Client
private void ShowShell() private void ShowShell()
{ {
if (Settings.ActionCenter.EnableActionCenter) if (Settings.UserInterface.ActionCenter.EnableActionCenter)
{ {
actionCenter.Promote(); actionCenter.Promote();
} }
if (Settings.Taskbar.EnableTaskbar) if (Settings.UserInterface.Taskbar.EnableTaskbar)
{ {
taskbar.Show(); taskbar.Show();
} }
@ -456,7 +456,7 @@ namespace SafeExamBrowser.Client
logger.Info("Trying to terminate Windows explorer..."); logger.Info("Trying to terminate Windows explorer...");
explorerShell.Terminate(); explorerShell.Terminate();
logger.Info("Re-initializing working area..."); logger.Info("Re-initializing working area...");
displayMonitor.InitializePrimaryDisplay(Settings.Taskbar.EnableTaskbar ? taskbar.GetAbsoluteHeight() : 0); displayMonitor.InitializePrimaryDisplay(Settings.UserInterface.Taskbar.EnableTaskbar ? taskbar.GetAbsoluteHeight() : 0);
logger.Info("Re-initializing shell..."); logger.Info("Re-initializing shell...");
actionCenter.InitializeBounds(); actionCenter.InitializeBounds();
taskbar.InitializeBounds(); taskbar.InitializeBounds();
@ -671,7 +671,7 @@ namespace SafeExamBrowser.Client
private void DisplayMonitor_DisplaySettingsChanged() private void DisplayMonitor_DisplaySettingsChanged()
{ {
logger.Info("Re-initializing working area..."); logger.Info("Re-initializing working area...");
displayMonitor.InitializePrimaryDisplay(Settings.Taskbar.EnableTaskbar ? taskbar.GetAbsoluteHeight() : 0); displayMonitor.InitializePrimaryDisplay(Settings.UserInterface.Taskbar.EnableTaskbar ? taskbar.GetAbsoluteHeight() : 0);
logger.Info("Re-initializing shell..."); logger.Info("Re-initializing shell...");
actionCenter.InitializeBounds(); actionCenter.InitializeBounds();

View file

@ -50,12 +50,12 @@ namespace SafeExamBrowser.Client.Operations
{ {
Context.Browser.Initialize(); Context.Browser.Initialize();
if (Context.Settings.ActionCenter.EnableActionCenter) if (Context.Settings.UserInterface.ActionCenter.EnableActionCenter)
{ {
actionCenter.AddApplicationControl(uiFactory.CreateApplicationControl(Context.Browser, Location.ActionCenter), true); actionCenter.AddApplicationControl(uiFactory.CreateApplicationControl(Context.Browser, Location.ActionCenter), true);
} }
if (Context.Settings.Taskbar.EnableTaskbar) if (Context.Settings.UserInterface.Taskbar.EnableTaskbar)
{ {
taskbar.AddApplicationControl(uiFactory.CreateApplicationControl(Context.Browser, Location.Taskbar), true); taskbar.AddApplicationControl(uiFactory.CreateApplicationControl(Context.Browser, Location.Taskbar), true);
} }

View file

@ -36,7 +36,7 @@ namespace SafeExamBrowser.Client.Operations
logger.Info("Initializing working area..."); logger.Info("Initializing working area...");
StatusChanged?.Invoke(TextKey.OperationStatus_InitializeWorkingArea); StatusChanged?.Invoke(TextKey.OperationStatus_InitializeWorkingArea);
displayMonitor.InitializePrimaryDisplay(Context.Settings.Taskbar.EnableTaskbar ? taskbar.GetAbsoluteHeight() : 0); displayMonitor.InitializePrimaryDisplay(Context.Settings.UserInterface.Taskbar.EnableTaskbar ? taskbar.GetAbsoluteHeight() : 0);
displayMonitor.StartMonitoringDisplayChanges(); displayMonitor.StartMonitoringDisplayChanges();
return OperationResult.Success; return OperationResult.Success;

View file

@ -107,7 +107,7 @@ namespace SafeExamBrowser.Client.Operations
{ {
foreach (var activator in Context.Activators) foreach (var activator in Context.Activators)
{ {
if (Context.Settings.ActionCenter.EnableActionCenter && activator is IActionCenterActivator actionCenterActivator) if (Context.Settings.UserInterface.ActionCenter.EnableActionCenter && activator is IActionCenterActivator actionCenterActivator)
{ {
actionCenter.Register(actionCenterActivator); actionCenter.Register(actionCenterActivator);
actionCenterActivator.Start(); actionCenterActivator.Start();
@ -124,7 +124,7 @@ namespace SafeExamBrowser.Client.Operations
terminationActivator.Start(); terminationActivator.Start();
} }
if (Context.Settings.Taskbar.EnableTaskbar && activator is ITaskbarActivator taskbarActivator) if (Context.Settings.UserInterface.Taskbar.EnableTaskbar && activator is ITaskbarActivator taskbarActivator)
{ {
taskbar.Register(taskbarActivator); taskbar.Register(taskbarActivator);
taskbarActivator.Start(); taskbarActivator.Start();
@ -134,7 +134,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeActionCenter() private void InitializeActionCenter()
{ {
if (Context.Settings.ActionCenter.EnableActionCenter) if (Context.Settings.UserInterface.ActionCenter.EnableActionCenter)
{ {
logger.Info("Initializing action center..."); logger.Info("Initializing action center...");
actionCenter.InitializeText(text); actionCenter.InitializeText(text);
@ -168,7 +168,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeTaskbar() private void InitializeTaskbar()
{ {
if (Context.Settings.Taskbar.EnableTaskbar) if (Context.Settings.UserInterface.Taskbar.EnableTaskbar)
{ {
logger.Info("Initializing taskbar..."); logger.Info("Initializing taskbar...");
taskbar.InitializeText(text); taskbar.InitializeText(text);
@ -232,7 +232,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeAboutNotificationForActionCenter() private void InitializeAboutNotificationForActionCenter()
{ {
if (Context.Settings.ActionCenter.ShowApplicationInfo) if (Context.Settings.UserInterface.ActionCenter.ShowApplicationInfo)
{ {
actionCenter.AddNotificationControl(uiFactory.CreateNotificationControl(aboutNotification, Location.ActionCenter)); actionCenter.AddNotificationControl(uiFactory.CreateNotificationControl(aboutNotification, Location.ActionCenter));
} }
@ -240,7 +240,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeAboutNotificationForTaskbar() private void InitializeAboutNotificationForTaskbar()
{ {
if (Context.Settings.Taskbar.ShowApplicationInfo) if (Context.Settings.UserInterface.Taskbar.ShowApplicationInfo)
{ {
taskbar.AddNotificationControl(uiFactory.CreateNotificationControl(aboutNotification, Location.Taskbar)); taskbar.AddNotificationControl(uiFactory.CreateNotificationControl(aboutNotification, Location.Taskbar));
} }
@ -248,7 +248,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeAudioForActionCenter() private void InitializeAudioForActionCenter()
{ {
if (Context.Settings.ActionCenter.ShowAudio) if (Context.Settings.UserInterface.ActionCenter.ShowAudio)
{ {
actionCenter.AddSystemControl(uiFactory.CreateAudioControl(audio, Location.ActionCenter)); actionCenter.AddSystemControl(uiFactory.CreateAudioControl(audio, Location.ActionCenter));
} }
@ -256,7 +256,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeAudioForTaskbar() private void InitializeAudioForTaskbar()
{ {
if (Context.Settings.Taskbar.ShowAudio) if (Context.Settings.UserInterface.Taskbar.ShowAudio)
{ {
taskbar.AddSystemControl(uiFactory.CreateAudioControl(audio, Location.Taskbar)); taskbar.AddSystemControl(uiFactory.CreateAudioControl(audio, Location.Taskbar));
} }
@ -264,17 +264,17 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeClockForActionCenter() private void InitializeClockForActionCenter()
{ {
actionCenter.ShowClock = Context.Settings.ActionCenter.ShowClock; actionCenter.ShowClock = Context.Settings.UserInterface.ActionCenter.ShowClock;
} }
private void InitializeClockForTaskbar() private void InitializeClockForTaskbar()
{ {
taskbar.ShowClock = Context.Settings.Taskbar.ShowClock; taskbar.ShowClock = Context.Settings.UserInterface.Taskbar.ShowClock;
} }
private void InitializeLogNotificationForActionCenter() private void InitializeLogNotificationForActionCenter()
{ {
if (Context.Settings.ActionCenter.ShowApplicationLog) if (Context.Settings.UserInterface.ActionCenter.ShowApplicationLog)
{ {
actionCenter.AddNotificationControl(uiFactory.CreateNotificationControl(logNotification, Location.ActionCenter)); actionCenter.AddNotificationControl(uiFactory.CreateNotificationControl(logNotification, Location.ActionCenter));
} }
@ -282,7 +282,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeLogNotificationForTaskbar() private void InitializeLogNotificationForTaskbar()
{ {
if (Context.Settings.Taskbar.ShowApplicationLog) if (Context.Settings.UserInterface.Taskbar.ShowApplicationLog)
{ {
taskbar.AddNotificationControl(uiFactory.CreateNotificationControl(logNotification, Location.Taskbar)); taskbar.AddNotificationControl(uiFactory.CreateNotificationControl(logNotification, Location.Taskbar));
} }
@ -290,7 +290,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeKeyboardLayoutForActionCenter() private void InitializeKeyboardLayoutForActionCenter()
{ {
if (Context.Settings.ActionCenter.ShowKeyboardLayout) if (Context.Settings.UserInterface.ActionCenter.ShowKeyboardLayout)
{ {
actionCenter.AddSystemControl(uiFactory.CreateKeyboardLayoutControl(keyboard, Location.ActionCenter)); actionCenter.AddSystemControl(uiFactory.CreateKeyboardLayoutControl(keyboard, Location.ActionCenter));
} }
@ -298,7 +298,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeKeyboardLayoutForTaskbar() private void InitializeKeyboardLayoutForTaskbar()
{ {
if (Context.Settings.Taskbar.ShowKeyboardLayout) if (Context.Settings.UserInterface.Taskbar.ShowKeyboardLayout)
{ {
taskbar.AddSystemControl(uiFactory.CreateKeyboardLayoutControl(keyboard, Location.Taskbar)); taskbar.AddSystemControl(uiFactory.CreateKeyboardLayoutControl(keyboard, Location.Taskbar));
} }
@ -332,7 +332,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeNetworkForActionCenter() private void InitializeNetworkForActionCenter()
{ {
if (Context.Settings.ActionCenter.ShowNetwork) if (Context.Settings.UserInterface.ActionCenter.ShowNetwork)
{ {
actionCenter.AddSystemControl(uiFactory.CreateNetworkControl(networkAdapter, Location.ActionCenter)); actionCenter.AddSystemControl(uiFactory.CreateNetworkControl(networkAdapter, Location.ActionCenter));
} }
@ -340,7 +340,7 @@ namespace SafeExamBrowser.Client.Operations
private void InitializeNetworkForTaskbar() private void InitializeNetworkForTaskbar()
{ {
if (Context.Settings.Taskbar.ShowNetwork) if (Context.Settings.UserInterface.Taskbar.ShowNetwork)
{ {
taskbar.AddSystemControl(uiFactory.CreateNetworkControl(networkAdapter, Location.Taskbar)); taskbar.AddSystemControl(uiFactory.CreateNetworkControl(networkAdapter, Location.Taskbar));
} }

View file

@ -575,12 +575,12 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
var useCustomForDesktop = rawData.TryGetValue(Keys.Browser.UserAgentModeDesktop, out var value) && value as int? != DEFAULT; var useCustomForDesktop = rawData.TryGetValue(Keys.Browser.UserAgentModeDesktop, out var value) && value as int? != DEFAULT;
var useCustomForMobile = rawData.TryGetValue(Keys.Browser.UserAgentModeMobile, out value) && value as int? != DEFAULT; var useCustomForMobile = rawData.TryGetValue(Keys.Browser.UserAgentModeMobile, out value) && value as int? != DEFAULT;
if (settings.UserInterfaceMode == UserInterfaceMode.Desktop && useCustomForDesktop) if (settings.UserInterface.Mode == UserInterfaceMode.Desktop && useCustomForDesktop)
{ {
settings.Browser.UseCustomUserAgent = true; settings.Browser.UseCustomUserAgent = true;
settings.Browser.CustomUserAgent = rawData[Keys.Browser.CustomUserAgentDesktop] as string; settings.Browser.CustomUserAgent = rawData[Keys.Browser.CustomUserAgentDesktop] as string;
} }
else if (settings.UserInterfaceMode == UserInterfaceMode.Mobile && useCustomForMobile) else if (settings.UserInterface.Mode == UserInterfaceMode.Mobile && useCustomForMobile)
{ {
settings.Browser.UseCustomUserAgent = true; settings.Browser.UseCustomUserAgent = true;
settings.Browser.CustomUserAgent = rawData[Keys.Browser.CustomUserAgentMobile] as string; settings.Browser.CustomUserAgent = rawData[Keys.Browser.CustomUserAgentMobile] as string;

View file

@ -97,12 +97,12 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
if (settings.Security.AllowApplicationLogAccess) if (settings.Security.AllowApplicationLogAccess)
{ {
settings.ActionCenter.ShowApplicationLog = true; settings.UserInterface.ActionCenter.ShowApplicationLog = true;
} }
else else
{ {
settings.ActionCenter.ShowApplicationLog = false; settings.UserInterface.ActionCenter.ShowApplicationLog = false;
settings.Taskbar.ShowApplicationLog = false; settings.UserInterface.Taskbar.ShowApplicationLog = false;
} }
} }

View file

@ -57,7 +57,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
{ {
if (value is bool enable) if (value is bool enable)
{ {
settings.ActionCenter.EnableActionCenter = enable; settings.UserInterface.ActionCenter.EnableActionCenter = enable;
} }
} }
@ -73,8 +73,8 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
{ {
if (value is bool show) if (value is bool show)
{ {
settings.ActionCenter.ShowAudio = show; settings.UserInterface.ActionCenter.ShowAudio = show;
settings.Taskbar.ShowAudio = show; settings.UserInterface.Taskbar.ShowAudio = show;
} }
} }
@ -82,8 +82,8 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
{ {
if (value is bool show) if (value is bool show)
{ {
settings.ActionCenter.ShowClock = show; settings.UserInterface.ActionCenter.ShowClock = show;
settings.Taskbar.ShowClock = show; settings.UserInterface.Taskbar.ShowClock = show;
} }
} }
@ -91,8 +91,8 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
{ {
if (value is bool show) if (value is bool show)
{ {
settings.ActionCenter.ShowKeyboardLayout = show; settings.UserInterface.ActionCenter.ShowKeyboardLayout = show;
settings.Taskbar.ShowKeyboardLayout = show; settings.UserInterface.Taskbar.ShowKeyboardLayout = show;
} }
} }
@ -100,8 +100,8 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
{ {
if (value is bool show) if (value is bool show)
{ {
settings.ActionCenter.ShowNetwork = show; settings.UserInterface.ActionCenter.ShowNetwork = show;
settings.Taskbar.ShowNetwork = show; settings.UserInterface.Taskbar.ShowNetwork = show;
} }
} }
@ -125,7 +125,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
{ {
if (value is bool enable) if (value is bool enable)
{ {
settings.Taskbar.EnableTaskbar = enable; settings.UserInterface.Taskbar.EnableTaskbar = enable;
} }
} }
@ -133,7 +133,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
{ {
if (value is bool show) if (value is bool show)
{ {
settings.Taskbar.ShowApplicationLog = show; settings.UserInterface.Taskbar.ShowApplicationLog = show;
} }
} }
@ -141,7 +141,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
{ {
if (value is bool mobile) if (value is bool mobile)
{ {
settings.UserInterfaceMode = mobile ? UserInterfaceMode.Mobile : UserInterfaceMode.Desktop; settings.UserInterface.Mode = mobile ? UserInterfaceMode.Mobile : UserInterfaceMode.Desktop;
} }
} }
} }

View file

@ -100,13 +100,6 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
{ {
var settings = new AppSettings(); var settings = new AppSettings();
settings.ActionCenter.EnableActionCenter = true;
settings.ActionCenter.ShowApplicationInfo = true;
settings.ActionCenter.ShowApplicationLog = false;
settings.ActionCenter.ShowClock = true;
settings.ActionCenter.ShowKeyboardLayout = true;
settings.ActionCenter.ShowNetwork = false;
settings.Applications.Blacklist.Add(new BlacklistApplication { ExecutableName = "AA_v3.exe", OriginalName = "AA_v3.exe" }); settings.Applications.Blacklist.Add(new BlacklistApplication { ExecutableName = "AA_v3.exe", OriginalName = "AA_v3.exe" });
settings.Applications.Blacklist.Add(new BlacklistApplication { ExecutableName = "AeroAdmin.exe", OriginalName = "AeroAdmin.exe" }); settings.Applications.Blacklist.Add(new BlacklistApplication { ExecutableName = "AeroAdmin.exe", OriginalName = "AeroAdmin.exe" });
settings.Applications.Blacklist.Add(new BlacklistApplication { ExecutableName = "beamyourscreen-host.exe", OriginalName = "beamyourscreen-host.exe" }); settings.Applications.Blacklist.Add(new BlacklistApplication { ExecutableName = "beamyourscreen-host.exe", OriginalName = "beamyourscreen-host.exe" });
@ -292,15 +285,20 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
settings.System.AlwaysOn = true; settings.System.AlwaysOn = true;
settings.Taskbar.EnableTaskbar = true; settings.UserInterface.ActionCenter.EnableActionCenter = true;
settings.Taskbar.ShowApplicationInfo = false; settings.UserInterface.ActionCenter.ShowApplicationInfo = true;
settings.Taskbar.ShowApplicationLog = false; settings.UserInterface.ActionCenter.ShowApplicationLog = false;
settings.Taskbar.ShowClock = true; settings.UserInterface.ActionCenter.ShowClock = true;
settings.Taskbar.ShowKeyboardLayout = true; settings.UserInterface.ActionCenter.ShowKeyboardLayout = true;
settings.Taskbar.ShowNetwork = false; settings.UserInterface.ActionCenter.ShowNetwork = false;
settings.UserInterface.LockScreen.BackgroundColor = "#ff0000"; settings.UserInterface.LockScreen.BackgroundColor = "#ff0000";
settings.UserInterfaceMode = UserInterfaceMode.Desktop; settings.UserInterface.Mode = UserInterfaceMode.Desktop;
settings.UserInterface.Taskbar.EnableTaskbar = true;
settings.UserInterface.Taskbar.ShowApplicationInfo = false;
settings.UserInterface.Taskbar.ShowApplicationLog = false;
settings.UserInterface.Taskbar.ShowClock = true;
settings.UserInterface.Taskbar.ShowKeyboardLayout = true;
settings.UserInterface.Taskbar.ShowNetwork = false;
return settings; return settings;
} }

View file

@ -103,7 +103,7 @@ namespace SafeExamBrowser.Runtime.Operations
var logFilePath = $"{'"' + Convert.ToBase64String(Encoding.UTF8.GetBytes(Context.Next.AppConfig.ClientLogFilePath)) + '"'}"; var logFilePath = $"{'"' + Convert.ToBase64String(Encoding.UTF8.GetBytes(Context.Next.AppConfig.ClientLogFilePath)) + '"'}";
var logLevel = Context.Next.Settings.LogLevel.ToString(); var logLevel = Context.Next.Settings.LogLevel.ToString();
var runtimeHostUri = Context.Next.AppConfig.RuntimeAddress; var runtimeHostUri = Context.Next.AppConfig.RuntimeAddress;
var uiMode = Context.Next.Settings.UserInterfaceMode.ToString(); var uiMode = Context.Next.Settings.UserInterface.Mode.ToString();
var clientReady = false; var clientReady = false;
var clientReadyEvent = new AutoResetEvent(false); var clientReadyEvent = new AutoResetEvent(false);

View file

@ -27,11 +27,6 @@ namespace SafeExamBrowser.Settings
[Serializable] [Serializable]
public class AppSettings public class AppSettings
{ {
/// <summary>
/// All settings related to the action center.
/// </summary>
public ActionCenterSettings ActionCenter { get; set; }
/// <summary> /// <summary>
/// All settings related to external applications. /// All settings related to external applications.
/// </summary> /// </summary>
@ -107,24 +102,13 @@ namespace SafeExamBrowser.Settings
/// </summary> /// </summary>
public SystemSettings System { get; set; } public SystemSettings System { get; set; }
/// <summary>
/// All taskbar-related settings.
/// </summary>
public TaskbarSettings Taskbar { get; set; }
/// <summary> /// <summary>
/// All settings related to the user interface. /// All settings related to the user interface.
/// </summary> /// </summary>
public UserInterfaceSettings UserInterface { get; set; } public UserInterfaceSettings UserInterface { get; set; }
/// <summary>
/// The mode which determines the look &amp; feel of the user interface.
/// </summary>
public UserInterfaceMode UserInterfaceMode { get; set; }
public AppSettings() public AppSettings()
{ {
ActionCenter = new ActionCenterSettings();
Applications = new ApplicationSettings(); Applications = new ApplicationSettings();
Audio = new AudioSettings(); Audio = new AudioSettings();
Browser = new BrowserSettings(); Browser = new BrowserSettings();
@ -137,7 +121,6 @@ namespace SafeExamBrowser.Settings
Server = new ServerSettings(); Server = new ServerSettings();
Service = new ServiceSettings(); Service = new ServiceSettings();
System = new SystemSettings(); System = new SystemSettings();
Taskbar = new TaskbarSettings();
UserInterface = new UserInterfaceSettings(); UserInterface = new UserInterfaceSettings();
} }
} }

View file

@ -16,14 +16,31 @@ namespace SafeExamBrowser.Settings.UserInterface
[Serializable] [Serializable]
public class UserInterfaceSettings public class UserInterfaceSettings
{ {
/// <summary>
/// All settings related to the action center.
/// </summary>
public ActionCenterSettings ActionCenter { get; set; }
/// <summary> /// <summary>
/// All settings related to the lock screen. /// All settings related to the lock screen.
/// </summary> /// </summary>
public LockScreenSettings LockScreen { get; set; } public LockScreenSettings LockScreen { get; set; }
/// <summary>
/// The mode which determines the look &amp; feel of the user interface.
/// </summary>
public UserInterfaceMode Mode { get; set; }
/// <summary>
/// All taskbar-related settings.
/// </summary>
public TaskbarSettings Taskbar { get; set; }
public UserInterfaceSettings() public UserInterfaceSettings()
{ {
ActionCenter = new ActionCenterSettings();
LockScreen = new LockScreenSettings(); LockScreen = new LockScreenSettings();
Taskbar = new TaskbarSettings();
} }
} }
} }