Restore SEBPatch

This commit is contained in:
2025-06-01 11:44:20 +02:00
commit 8c656e3137
1297 changed files with 142172 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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.Monitoring.Contracts.Display.Events
{
/// <summary>
/// Indicates that the configuration of a display has changed.
/// </summary>
public delegate void DisplayChangedEventHandler();
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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.Monitoring.Contracts.Display.Events;
using SafeExamBrowser.Settings.Monitoring;
namespace SafeExamBrowser.Monitoring.Contracts.Display
{
/// <summary>
/// Monitors the displays of the computer for changes and provides access to display-related functionality.
/// </summary>
public interface IDisplayMonitor
{
/// <summary>
/// Event fired when the primary display or its settings have changed.
/// </summary>
event DisplayChangedEventHandler DisplayChanged;
/// <summary>
/// Sets the desktop working area to accommodate to the taskbar's height and removes the configured wallpaper (if possible).
/// </summary>
void InitializePrimaryDisplay(int taskbarHeight);
/// <summary>
/// Resets the desktop working area and wallpaper to their previous (initial) state.
/// </summary>
void ResetPrimaryDisplay();
/// <summary>
/// Starts monitoring for display changes, i.e. display changes will trigger the <c>DisplaySettingsChanged</c> event.
/// </summary>
void StartMonitoringDisplayChanges();
/// <summary>
/// Stops monitoring for display changes.
/// </summary>
void StopMonitoringDisplayChanges();
/// <summary>
/// Validates the currently active display configuration according to the given settings.
/// </summary>
ValidationResult ValidateConfiguration(DisplaySettings settings);
}
}

View File

@@ -0,0 +1,31 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* 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.Monitoring.Contracts.Display
{
/// <summary>
/// Provides the result of a display configuration validation.
/// </summary>
public class ValidationResult
{
/// <summary>
/// Specifies the count of external displays detected.
/// </summary>
public int ExternalDisplays { get; set; }
/// <summary>
/// Specifies the count of internal displays detected.
/// </summary>
public int InternalDisplays { get; set; }
/// <summary>
/// Indicates whether the active display configuration is allowed.
/// </summary>
public bool IsAllowed { get; set; }
}
}