-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.xaml.cs
53 lines (45 loc) · 957 Bytes
/
MainWindow.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Windows.Input;
using SimpleDesktopShell.Security;
using SimpleDesktopShell.Security.Tweaks;
namespace SimpleDesktopShell
{
public sealed partial class MainWindow : Window
{
private readonly ITweak tweaks = new Tweaker
{
BeforeReloadTweaks = new List<ITweak>
{
new WindowsButtonDisabler(),
new CommandLineDisabler(),
},
AfterReloadTweaks = new List<ITweak>
{
new TaskbarDisabler(),
new TaskManagerDisabler(),
},
};
public MainWindow()
{
tweaks.Enable();
InitializeComponent();
PreviewKeyDown += (object sender, KeyEventArgs e) =>
{
if (e.Key == Key.System)
{
e.Handled = true;
}
};
}
private void Window_Closing(object sender, CancelEventArgs e)
{
tweaks.Disable();
}
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}