-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml.cs
97 lines (80 loc) · 2.94 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using Pluton;
using Pluton.WindowsSystemFeatures;
using System;
using System.IO;
using System.Windows;
namespace SysFunctionals {
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
}
private void ShutdownClicked(object sender, RoutedEventArgs e) {
statusUpdateLabel.Content = "Shutting down...";
PTools.Shutdown(false);
}
private void RestartClicked(object sender, RoutedEventArgs e) {
statusUpdateLabel.Content = "Restarting now";
PTools.Shutdown(true);
}
private void ScreenshotClicked(object sender, RoutedEventArgs e) {
string fileName = DateTime.Now.Ticks.ToString();
PTools.Screenshot(fileName);
statusUpdateLabel.Content = $"Screenshot saved @ {Directory.GetCurrentDirectory()} with name {fileName}";
}
private void UACClicked(object sender, RoutedEventArgs e) {
PSecuritySystems.DisableUAC();
statusUpdateLabel.Content = "UAC Disabled.";
}
private void DisableDefenderClicked(object sender, RoutedEventArgs e) {
PSecuritySystems.WindowsDefender(false);
statusUpdateLabel.Content = "Defender disabled.";
}
private void EnableDefenderClicked(object sender, RoutedEventArgs e) {
PSecuritySystems.WindowsDefender(true);
statusUpdateLabel.Content = "Defender enabled.";
}
private void DisableFirewallClicked(object sender, RoutedEventArgs e) {
PSecuritySystems.Firewall(false);
statusUpdateLabel.Content = "Firewall disabled.";
}
private void EnableFirewallClicked(object sender, RoutedEventArgs e) {
PSecuritySystems.Firewall(true);
statusUpdateLabel.Content = "Firewall enabled.";
}
private void DisableSmartScreenClicked(object sender, RoutedEventArgs e) {
PSecuritySystems.SmartScreen(false);
statusUpdateLabel.Content = "SmartScreen disabled.";
}
private void EnableSmartScreenClicked(object sender, RoutedEventArgs e) {
PSecuritySystems.SmartScreen(true);
statusUpdateLabel.Content = "SmartScreen enabled.";
}
private void HideTaskbarClicked(object sender, RoutedEventArgs e) {
PDesktop.HideTaskBar();
statusUpdateLabel.Content = "Taskbar hidden.";
}
private void ShowTaskbarClicked(object sender, RoutedEventArgs e) {
PDesktop.ShowTaskBar();
statusUpdateLabel.Content = "Taskbar shown.";
}
private void SetDarkThemeClicked(object sender, RoutedEventArgs e) {
PDesktop.SetTheme(false);
statusUpdateLabel.Content = "Dark theme set.";
}
private void SetLightThemeClicked(object sender, RoutedEventArgs e) {
PDesktop.SetTheme(true);
statusUpdateLabel.Content = "Light theme set.";
}
private void TurnOffInternetClicked(object sender, RoutedEventArgs e) {
PNetwork.InternetConnection(false);
statusUpdateLabel.Content = "Internet disabled.";
}
private void TurnOnInternetClicked(object sender, RoutedEventArgs e) {
PNetwork.InternetConnection(true);
statusUpdateLabel.Content = "Internet enabled.";
}
}
}