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;
|
|
|
|
|
using System.Windows.Controls;
|
2019-12-03 15:43:48 +01:00
|
|
|
|
using SafeExamBrowser.Applications.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
|
|
|
|
|
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 TaskbarQuitButton : 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 TaskbarQuitButton()
|
2017-08-22 10:29:00 +02:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2017-08-23 08:32:44 +02:00
|
|
|
|
LoadIcon();
|
2017-08-22 10:29:00 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2018-06-21 08:54:43 +02:00
|
|
|
|
Clicked?.Invoke(new CancelEventArgs());
|
2017-08-22 10:29:00 +02:00
|
|
|
|
}
|
2017-08-23 08:32:44 +02:00
|
|
|
|
|
|
|
|
|
private void LoadIcon()
|
|
|
|
|
{
|
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
|
|
|
|
|
|
|
|
|
Button.Content = IconResourceLoader.Load(resource);
|
|
|
|
|
}
|
2017-08-22 10:29:00 +02:00
|
|
|
|
}
|
|
|
|
|
}
|