2017-08-22 10:58:36 +02:00
|
|
|
|
/*
|
2024-03-05 18:37:42 +01:00
|
|
|
|
* Copyright (c) 2024 ETH Zürich, IT Services
|
2017-08-22 10:58:36 +02:00
|
|
|
|
*
|
|
|
|
|
* 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 System.Windows;
|
|
|
|
|
using System.Windows.Documents;
|
2019-08-13 10:02:05 +02:00
|
|
|
|
using System.Windows.Media;
|
2019-08-30 09:55:26 +02:00
|
|
|
|
using SafeExamBrowser.Configuration.Contracts;
|
|
|
|
|
using SafeExamBrowser.I18n.Contracts;
|
|
|
|
|
using SafeExamBrowser.UserInterface.Contracts.Windows;
|
|
|
|
|
using SafeExamBrowser.UserInterface.Contracts.Windows.Events;
|
2017-08-22 10:58:36 +02:00
|
|
|
|
|
2020-03-16 18:29:06 +01:00
|
|
|
|
namespace SafeExamBrowser.UserInterface.Desktop.Windows
|
2017-08-22 10:58:36 +02:00
|
|
|
|
{
|
2020-03-16 18:29:06 +01:00
|
|
|
|
internal partial class AboutWindow : Window, IWindow
|
2017-08-22 10:58:36 +02:00
|
|
|
|
{
|
2022-02-23 13:59:36 +01:00
|
|
|
|
private readonly AppConfig appConfig;
|
|
|
|
|
private readonly IText text;
|
|
|
|
|
|
|
|
|
|
private WindowClosedEventHandler closed;
|
2017-08-22 10:58:36 +02:00
|
|
|
|
private WindowClosingEventHandler closing;
|
|
|
|
|
|
2022-02-23 13:59:36 +01:00
|
|
|
|
event WindowClosedEventHandler IWindow.Closed
|
|
|
|
|
{
|
|
|
|
|
add { closed += value; }
|
|
|
|
|
remove { closed -= value; }
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-22 10:58:36 +02:00
|
|
|
|
event WindowClosingEventHandler IWindow.Closing
|
|
|
|
|
{
|
|
|
|
|
add { closing += value; }
|
|
|
|
|
remove { closing -= value; }
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-16 18:29:06 +01:00
|
|
|
|
internal AboutWindow(AppConfig appConfig, IText text)
|
2017-08-22 10:58:36 +02:00
|
|
|
|
{
|
2018-06-29 09:50:20 +02:00
|
|
|
|
this.appConfig = appConfig;
|
2017-08-22 10:58:36 +02:00
|
|
|
|
this.text = text;
|
|
|
|
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
InitializeAboutWindow();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void BringToForeground()
|
|
|
|
|
{
|
|
|
|
|
Activate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void InitializeAboutWindow()
|
|
|
|
|
{
|
2022-02-23 13:59:36 +01:00
|
|
|
|
Closed += (o, args) => closed?.Invoke();
|
2017-08-22 10:58:36 +02:00
|
|
|
|
Closing += (o, args) => closing?.Invoke();
|
2020-01-21 09:43:25 +01:00
|
|
|
|
MainText.Inlines.InsertBefore(MainText.Inlines.FirstInline, new Run(text.Get(TextKey.AboutWindow_LicenseInfo)));
|
2020-03-09 17:35:48 +01:00
|
|
|
|
Title = text.Get(TextKey.AboutWindow_Title);
|
2020-01-21 09:43:25 +01:00
|
|
|
|
|
2019-08-13 10:02:05 +02:00
|
|
|
|
VersionInfo.Inlines.Add(new Run($"{text.Get(TextKey.Version)} {appConfig.ProgramInformationalVersion}") { FontSize = 12 });
|
2017-08-22 10:58:36 +02:00
|
|
|
|
VersionInfo.Inlines.Add(new LineBreak());
|
2019-08-13 10:02:05 +02:00
|
|
|
|
VersionInfo.Inlines.Add(new Run($"{text.Get(TextKey.Build)} {appConfig.ProgramBuildVersion}") { FontSize = 8, Foreground = Brushes.Gray });
|
2017-08-22 10:58:36 +02:00
|
|
|
|
VersionInfo.Inlines.Add(new LineBreak());
|
2019-08-13 10:02:05 +02:00
|
|
|
|
VersionInfo.Inlines.Add(new LineBreak());
|
|
|
|
|
VersionInfo.Inlines.Add(new Run(appConfig.ProgramCopyright) { FontSize = 10, Foreground = Brushes.Gray });
|
2017-08-22 10:58:36 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|