2017-08-22 10:29:00 +02:00
|
|
|
|
/*
|
2024-03-05 18:37:42 +01:00
|
|
|
|
* Copyright (c) 2024 ETH Zürich, IT Services
|
2017-08-22 10:29:00 +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/.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-08-23 08:32:44 +02:00
|
|
|
|
using System;
|
2018-06-21 08:54:43 +02:00
|
|
|
|
using System.ComponentModel;
|
2017-08-22 10:29:00 +02:00
|
|
|
|
using System.Windows.Controls;
|
2021-03-18 23:12:07 +01:00
|
|
|
|
using SafeExamBrowser.Core.Contracts.Resources.Icons;
|
2019-08-30 09:55:26 +02:00
|
|
|
|
using SafeExamBrowser.UserInterface.Contracts.Shell.Events;
|
2019-05-08 09:56:34 +02:00
|
|
|
|
using SafeExamBrowser.UserInterface.Shared.Utilities;
|
2017-08-22 10:29:00 +02:00
|
|
|
|
|
2020-03-16 18:29:06 +01:00
|
|
|
|
namespace SafeExamBrowser.UserInterface.Desktop.Controls.ActionCenter
|
2017-08-22 10:29:00 +02:00
|
|
|
|
{
|
2020-03-16 18:29:06 +01:00
|
|
|
|
internal partial class QuitButton : UserControl
|
2017-08-22 10:29:00 +02:00
|
|
|
|
{
|
2020-03-16 18:29:06 +01:00
|
|
|
|
internal event QuitButtonClickedEventHandler Clicked;
|
2018-02-20 15:15:26 +01:00
|
|
|
|
|
2020-03-16 18:29:06 +01:00
|
|
|
|
public QuitButton()
|
2017-08-22 10:29:00 +02:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2019-03-15 11:38:59 +01:00
|
|
|
|
InitializeControl();
|
2017-08-22 10:29:00 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-03-15 11:38:59 +01:00
|
|
|
|
private void InitializeControl()
|
2017-08-23 08:32:44 +02:00
|
|
|
|
{
|
2019-01-11 15:32:47 +01:00
|
|
|
|
var uri = new Uri("pack://application:,,,/SafeExamBrowser.UserInterface.Desktop;component/Images/ShutDown.xaml");
|
2019-12-03 15:43:48 +01:00
|
|
|
|
var resource = new XamlIconResource { Uri = uri };
|
2017-08-23 08:32:44 +02:00
|
|
|
|
|
2019-03-15 11:38:59 +01:00
|
|
|
|
Icon.Content = IconResourceLoader.Load(resource);
|
|
|
|
|
Button.Click += (o, args) => Clicked?.Invoke(new CancelEventArgs());
|
2017-08-23 08:32:44 +02:00
|
|
|
|
}
|
2017-08-22 10:29:00 +02:00
|
|
|
|
}
|
|
|
|
|
}
|