Restore SEBPatch

This commit is contained in:
2025-06-01 11:56:28 +02:00
parent 8c656e3137
commit 00707825b4
1009 changed files with 5005 additions and 6502 deletions

View File

@@ -30,52 +30,57 @@
<LineBreak />
<Bold><Underline>.NET Framework</Underline></Bold>
<LineBreak />
Copyright © 2002-2024 Microsoft. All rights reserved.
Copyright © 2002-2025 Microsoft. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>Bouncy Castle</Underline></Bold>
<LineBreak />
Copyright © 2000-2025 Legion of the Bouncy Castle Inc. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>CefSharp (.NET bindings for the Chromium Embedded Framework)</Underline></Bold>
<LineBreak />
Copyright © 2010-2024 The CefSharp Authors. All rights reserved.
Copyright © 2010-2025 The CefSharp Authors. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>CEF (Chromium Embedded Framework)</Underline></Bold>
<LineBreak />
Copyright © 2008-2024 The Chromium Embedded Framework Authors. All rights reserved.
Copyright © 2008-2025 The Chromium Embedded Framework Authors. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>Font-Awesome-WPF</Underline></Bold>
<LineBreak />
Copyright © 2014-2024 charri. All rights reserved.
Copyright © 2014-2025 charri. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>KGy SOFT Core &amp; Drawing Libraries</Underline></Bold>
<LineBreak />
Copyright © 2005-2024 KGy SOFT. All rights reserved.
Copyright © 2005-2025 KGy SOFT. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>KnownFolders</Underline></Bold>
<LineBreak />
Copyright © 2017-2024 Syroot. All rights reserved.
Copyright © 2017-2025 Syroot. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>Microsoft.Windows.SDK.Contracts</Underline></Bold>
<LineBreak />
Copyright © 2019-2024 Microsoft. All rights reserved.
Copyright © 2019-2025 Microsoft. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>NAudio</Underline></Bold>
<LineBreak />
Copyright © 2008-2024 Mark Heath &amp; contributors. All rights reserved.
Copyright © 2008-2025 Mark Heath &amp; contributors. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>Newtonsoft.Json</Underline></Bold>
<LineBreak />
Copyright © 2007-2024 James Newton-King. All rights reserved.
Copyright © 2007-2025 James Newton-King. All rights reserved.
<LineBreak />
<LineBreak />
<Bold><Underline>Visual C++ Redistributable</Underline></Bold>
<LineBreak />
Copyright © 1993-2024 Microsoft. All rights reserved.
Copyright © 1993-2025 Microsoft. All rights reserved.
</TextBlock>
</ScrollViewer>
</Grid>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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
@@ -8,8 +8,10 @@
using System;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Interop;
@@ -42,8 +44,8 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
private WindowClosedEventHandler closed;
private WindowClosingEventHandler closing;
private bool browserControlGetsFocusFromTaskbar = false;
private IInputElement tabKeyDownFocusElement = null;
private bool browserControlGetsFocusFromTaskbar;
private IInputElement tabKeyDownFocusElement;
private WindowSettings WindowSettings
{
@@ -197,27 +199,15 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
{
Dispatcher.InvokeAsync(() =>
{
var isNewItem = true;
var control = Downloads.Children.OfType<DownloadItemControl>().FirstOrDefault(c => c.Id == state.Id);
foreach (var child in Downloads.Children)
if (control == default)
{
if (child is DownloadItemControl control && control.Id == state.Id)
{
control.Update(state);
isNewItem = false;
break;
}
}
if (isNewItem)
{
var control = new DownloadItemControl(state.Id, text);
control.Update(state);
control = new DownloadItemControl(state.Id, text);
Downloads.Children.Add(control);
}
control.Update(state);
DownloadsButton.Visibility = Visibility.Visible;
DownloadsPopup.IsOpen = IsActive;
});
@@ -252,7 +242,13 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
{
if (isMainWindow)
{
e.Cancel = true;
//e.Cancel = true;
Dispatcher.Invoke(() =>
{
Closing -= BrowserWindow_Closing;
closing?.Invoke();
base.Close();
});
}
else
{
@@ -265,12 +261,15 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
if (e.Key == Key.Tab)
{
var hasShift = (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift;
if (Toolbar.IsKeyboardFocusWithin && hasShift)
{
var firstActiveElementInToolbar = Toolbar.PredictFocus(FocusNavigationDirection.Right);
if (firstActiveElementInToolbar is System.Windows.UIElement)
if (firstActiveElementInToolbar is UIElement)
{
var control = firstActiveElementInToolbar as System.Windows.UIElement;
var control = firstActiveElementInToolbar as UIElement;
if (control.IsKeyboardFocusWithin)
{
LoseFocusRequested?.Invoke(false);
@@ -322,10 +321,8 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
else if (MenuPopup.IsKeyboardFocusWithin)
{
var focusedElement = FocusManager.GetFocusedElement(this);
var focusedControl = focusedElement as System.Windows.Controls.Control;
var prevFocusedControl = tabKeyDownFocusElement as System.Windows.Controls.Control;
if (focusedControl != null && prevFocusedControl != null)
if (focusedElement is Control focusedControl && tabKeyDownFocusElement is Control prevFocusedControl)
{
if (!hasShift && focusedControl.TabIndex < prevFocusedControl.TabIndex)
{
@@ -354,7 +351,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
if (isMainWindow)
{
this.DisableCloseButton();
//this.DisableCloseButton();
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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
@@ -19,6 +19,9 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
{
private readonly IText text;
private bool cancellationRequested;
private bool initialized;
public ProctoringFinalizationDialog(IText text)
{
this.text = text;
@@ -65,8 +68,6 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
private void InitializeDialog()
{
Button.Click += (o, args) => Close();
Button.Content = text.Get(TextKey.ProctoringFinalizationDialog_Confirm);
Title = text.Get(TextKey.ProctoringFinalizationDialog_Title);
InitializeBounds();
@@ -76,6 +77,8 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
private void ShowFailure(RemainingWorkUpdatedEventArgs status)
{
Button.Click += (o, args) => Close();
Button.Content = text.Get(TextKey.ProctoringFinalizationDialog_Confirm);
ButtonPanel.Visibility = Visibility.Visible;
// TODO: Revert once cache handling has been specified and changed!
@@ -90,41 +93,68 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
private void ShowProgress(RemainingWorkUpdatedEventArgs status)
{
ButtonPanel.Visibility = Visibility.Collapsed;
ButtonPanel.Visibility = status.AllowCancellation ? Visibility.Visible : Visibility.Collapsed;
Cursor = Cursors.Wait;
FailurePanel.Visibility = Visibility.Collapsed;
Info.Text = text.Get(TextKey.ProctoringFinalizationDialog_InfoMessage);
ProgressPanel.Visibility = Visibility.Visible;
if (status.AllowCancellation && !initialized)
{
Button.Click += (o, args) => cancellationRequested = true;
Button.Content = text.Get(TextKey.ProctoringFinalizationDialog_Abort);
initialized = true;
}
if (status.IsWaiting)
{
var count = $"{status.Total - status.Progress}";
var time = $"{status.Resume.ToLongTimeString()}";
Percentage.Text = "";
Progress.IsIndeterminate = true;
Status.Text = text.Get(TextKey.ProctoringFinalizationDialog_StatusWaiting).Replace("%%_COUNT_%%", count).Replace("%%_TIME_%%", time);
UpdateWaitingProgress(status);
}
else
{
var count = $"{status.Progress}";
var total = $"{status.Total}";
UpdateProgress(status);
}
Percentage.Text = $"{status.Progress / (double) (status.Total > 0 ? status.Total : 1) * 100:N0}%";
Progress.IsIndeterminate = false;
Progress.Maximum = status.Total;
Progress.Value = status.Progress;
status.CancellationRequested = cancellationRequested;
}
if (status.Next.HasValue)
{
Status.Text = text.Get(TextKey.ProctoringFinalizationDialog_StatusAndTime).Replace("%%_TIME_%%", $"{status.Next.Value.ToLongTimeString()}");
}
else
{
Status.Text = text.Get(TextKey.ProctoringFinalizationDialog_Status);
}
private void UpdateProgress(RemainingWorkUpdatedEventArgs status)
{
var count = $"{status.Progress}";
var total = $"{status.Total}";
Status.Text = Status.Text.Replace("%%_COUNT_%%", count).Replace("%%_TOTAL_%%", total);
Percentage.Text = $"{status.Progress / (double) (status.Total > 0 ? status.Total : 1) * 100:N0}%";
Progress.IsIndeterminate = false;
Progress.Maximum = status.Total;
Progress.Value = status.Progress;
if (status.Next.HasValue)
{
Status.Text = text.Get(TextKey.ProctoringFinalizationDialog_StatusAndTime).Replace("%%_TIME_%%", $"{status.Next.Value.ToLongTimeString()}");
}
else
{
Status.Text = text.Get(TextKey.ProctoringFinalizationDialog_Status);
}
Status.Text = Status.Text.Replace("%%_COUNT_%%", count).Replace("%%_TOTAL_%%", total);
}
private void UpdateWaitingProgress(RemainingWorkUpdatedEventArgs status)
{
var count = $"{status.Total - status.Progress}";
var time = status.Resume?.ToLongTimeString();
Percentage.Text = "";
Progress.IsIndeterminate = true;
if (status.Resume.HasValue)
{
Status.Text = text.Get(TextKey.ProctoringFinalizationDialog_StatusWaitingAndTime).Replace("%%_COUNT_%%", count).Replace("%%_TIME_%%", time);
}
else
{
Status.Text = text.Get(TextKey.ProctoringFinalizationDialog_StatusWaiting).Replace("%%_COUNT_%%", count);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
* Copyright (c) 2025 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