2017-08-22 10:58:36 +02:00
|
|
|
|
/*
|
2019-01-09 11:25:21 +01:00
|
|
|
|
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
|
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;
|
2018-01-17 14:08:39 +01:00
|
|
|
|
using SafeExamBrowser.Contracts.Configuration;
|
2017-08-22 10:58:36 +02:00
|
|
|
|
using SafeExamBrowser.Contracts.I18n;
|
2018-03-14 12:07:20 +01:00
|
|
|
|
using SafeExamBrowser.Contracts.UserInterface.Windows;
|
2019-03-06 16:10:00 +01:00
|
|
|
|
using SafeExamBrowser.Contracts.UserInterface.Windows.Events;
|
2017-08-22 10:58:36 +02:00
|
|
|
|
|
2019-01-11 15:32:47 +01:00
|
|
|
|
namespace SafeExamBrowser.UserInterface.Desktop
|
2017-08-22 10:58:36 +02:00
|
|
|
|
{
|
|
|
|
|
public partial class AboutWindow : Window, IWindow
|
|
|
|
|
{
|
2018-06-29 09:50:20 +02:00
|
|
|
|
private AppConfig appConfig;
|
2017-08-22 10:58:36 +02:00
|
|
|
|
private IText text;
|
|
|
|
|
private WindowClosingEventHandler closing;
|
|
|
|
|
|
|
|
|
|
event WindowClosingEventHandler IWindow.Closing
|
|
|
|
|
{
|
|
|
|
|
add { closing += value; }
|
|
|
|
|
remove { closing -= value; }
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-29 09:50:20 +02:00
|
|
|
|
public 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()
|
|
|
|
|
{
|
|
|
|
|
Closing += (o, args) => closing?.Invoke();
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|