2017-08-22 10:29:00 +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: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;
|
2019-11-06 08:45:37 +01:00
|
|
|
|
using SafeExamBrowser.Core.Contracts;
|
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
|
|
|
|
|
2019-01-11 15:32:47 +01:00
|
|
|
|
namespace SafeExamBrowser.UserInterface.Desktop.Controls
|
2017-08-22 10:29:00 +02:00
|
|
|
|
{
|
2019-03-15 11:38:59 +01:00
|
|
|
|
public partial class ActionCenterQuitButton : UserControl
|
2017-08-22 10:29:00 +02:00
|
|
|
|
{
|
2018-06-21 08:54:43 +02:00
|
|
|
|
public event QuitButtonClickedEventHandler Clicked;
|
2018-02-20 15:15:26 +01:00
|
|
|
|
|
2019-03-15 11:38:59 +01:00
|
|
|
|
public ActionCenterQuitButton()
|
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-11-06 08:45:37 +01:00
|
|
|
|
var resource = new IconResource { Type = IconResourceType.Xaml, 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
|
|
|
|
}
|
|
|
|
|
}
|