Skip to content

Commit fe6e2e5

Browse files
reverted to .Net Framework 4.8 + bug fixes
1 parent de77c55 commit fe6e2e5

22 files changed

+249
-253
lines changed

Global_Functions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using EXT.HashTools;
1010
using EXT.Launcher.Powershell;
1111
using EXT.Launcher.Process;
12-
using Microsoft.Win32;
1312

1413
namespace WinUtil
1514
{

Machine_Info.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace WinUtil
44
{
5-
internal static class Machine
5+
internal struct Machine
66
{
77
internal static HostRole Role;
88

MainWindow/CommonLogic.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Threading.Tasks;
2+
//
3+
using EXT.Launcher.Process;
4+
5+
namespace WinUtil
6+
{
7+
internal static class Common
8+
{
9+
internal static async Task RestartExplorer()
10+
{
11+
xProcess.Run("C:\\Windows\\System32\\taskkill.exe", "/IM explorer.exe /F", WaitForExit: true, HiddenExecute: true);
12+
await Task.Delay(1000).ConfigureAwait(false);
13+
xProcess.Run("C:\\Windows\\explorer.exe", null, WaitForExit: true, HiddenExecute: true);
14+
}
15+
16+
17+
18+
19+
}
20+
}

MainWindow/Grid_Tabs/1_OverviewGrid.xaml.cs renamed to MainWindow/Grid_Tabs/1. Overview/OverviewGrid.xaml.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ public OverviewGrid()
2222
uptimeClock.Start();
2323

2424
Loaded += OnLoaded;
25-
26-
SetInfoBox();
2725
}
2826

2927
//
@@ -90,16 +88,7 @@ private void UISetter()
9088
SecBoot.Text = secureBootIsOn;
9189
}
9290

93-
private async Task SetInfoBox()
94-
{
95-
while (LicenseMessage == null)
96-
{
97-
await Task.Delay(512).ConfigureAwait(true);
98-
}
99-
100-
LicenseStatus.Text = LicenseMessage;
101-
}
102-
91+
10392

10493

10594

MainWindow/Grid_Tabs/2_AppearanceGrid.xaml renamed to MainWindow/Grid_Tabs/2. Appearance/Appearance_UserControl.xaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<ScrollViewer Style="{DynamicResource ScrollViewer}"
1212
VerticalScrollBarVisibility="Auto" Margin="0,0,0,0">
13-
13+
1414
<Grid Margin="3,0,0,0">
1515

1616
<TextBlock
@@ -30,7 +30,7 @@
3030
Height="17"
3131
VerticalAlignment="Top" HorizontalAlignment="Right" Width="70"/>
3232

33-
<ToggleButton x:Name="Bright_Mode_Switch" Style="{DynamicResource Sys_Dark-Light}"
33+
<ToggleButton x:Name="OSTheme_ToggleButton" Style="{DynamicResource Sys_Dark-Light}"
3434
Margin="0,24,50,0"
3535
Height="40" Width="78"
3636
VerticalAlignment="Top" HorizontalAlignment="Right"
@@ -63,13 +63,13 @@
6363
FontWeight="DemiBold"
6464
FontSize="11"/>
6565

66-
<ToggleButton x:Name="Theme_Switch" Style="{DynamicResource Default_Switch}"
66+
<ToggleButton x:Name="ContextMenu_ToggleButton" Style="{DynamicResource Default_Switch}"
6767
Margin="0,7,46,0"
6868
Opacity="1"
6969
Height="20" Width="40"
7070
VerticalAlignment="Top" HorizontalAlignment="Right"
71-
Checked="ContextMenuToggle"
72-
Unchecked="ContextMenuToggle"/>
71+
Checked="ContextMenu_ToggleButton_Handler"
72+
Unchecked="ContextMenu_ToggleButton_Handler"/>
7373
</Grid>
7474
</Button>
7575

@@ -99,13 +99,13 @@
9999
FontWeight="DemiBold"
100100
FontSize="11"/>
101101

102-
<ToggleButton x:Name="Terminal_Integrator_SW" Style="{DynamicResource Default_Switch}"
102+
<ToggleButton x:Name="Terminal_Integration_ToggleButton" Style="{DynamicResource Default_Switch}"
103103
Margin="0,7,46,0"
104104
Opacity="1"
105105
Height="20" Width="40"
106106
VerticalAlignment="Top" HorizontalAlignment="Right"
107-
Checked="Terminal_IntegratorToggle"
108-
Unchecked="Terminal_IntegratorToggle"/>
107+
Checked="Terminal_Integration_ToggleButton_Handler"
108+
Unchecked="Terminal_Integration_ToggleButton_Handler"/>
109109
</Grid>
110110
</Button>
111111

@@ -124,4 +124,4 @@
124124
</ScrollViewer>
125125

126126
</Grid>
127-
</UserControl>
127+
</UserControl>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
using Microsoft.Win32;
2+
using System;
3+
using System.Windows;
4+
using System.Windows.Controls;
5+
using System.Windows.Media;
6+
//
7+
using EXT.System.Registry;
8+
9+
namespace WinUtil.Grid_Tabs
10+
{
11+
public partial class AppearanceGrid : UserControl
12+
{
13+
public AppearanceGrid()
14+
{
15+
InitializeComponent();
16+
17+
Loaded += OnLoaded;
18+
}
19+
20+
private void OnLoaded(object sender, RoutedEventArgs e)
21+
{
22+
Init_Theme_Switch();
23+
24+
Init_Context_Button();
25+
26+
Init_Terminal_Integrator_Button();
27+
28+
Visibility = Visibility.Collapsed;
29+
}
30+
31+
//# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
32+
33+
private void Init_Theme_Switch()
34+
{
35+
Int32 v0 = xRegistry.Get.Value("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "SystemUsesLightTheme", RegistryValueKind.DWord);
36+
Int32 v1 = xRegistry.Get.Value("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "AppsUseLightTheme", RegistryValueKind.DWord);
37+
38+
if ((v0 == 1) || (v1 == 1))
39+
{
40+
OSTheme_ToggleButton.Checked -= Set_System_Theme_Toggle;
41+
OSTheme_ToggleButton.IsChecked = true;
42+
OSTheme_ToggleButton.Checked += Set_System_Theme_Toggle;
43+
}
44+
}
45+
46+
private void Init_Context_Button()
47+
{
48+
if (xRegistry.TestRegValuePresense(@"HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32", ""))
49+
{
50+
ContextMenu_ToggleButton.Checked -= ContextMenu_ToggleButton_Handler;
51+
ContextMenu_ToggleButton.IsChecked = true;
52+
ContextMenu_ToggleButton.Checked += ContextMenu_ToggleButton_Handler;
53+
}
54+
}
55+
internal void External_Set_OS_Aware_Context_Button_State()
56+
{
57+
if (Machine.UIVersion == Machine.WindowsUIVersion.Windows10)
58+
{
59+
Context_Button.IsEnabled = false;
60+
Context_Button_Icon.Opacity = 0.41;
61+
ContextMenu_ToggleButton.Opacity = 0.41;
62+
Context_Button_Head.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#747474"));
63+
Context_Button_Body.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#747474"));
64+
}
65+
}
66+
67+
private void Init_Terminal_Integrator_Button()
68+
{
69+
if (xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHere", "Extended")
70+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHere", "Icon")
71+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHere", "MUIVerb")
72+
73+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin", "Extended")
74+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin", "HasLUAShield")
75+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin", "Icon")
76+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\Background\shell\OpenWTHereAsAdmin", "MUIVerb")
77+
78+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\shell\OpenWTHere", "Extended")
79+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\shell\OpenWTHere", "Icon")
80+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\shell\OpenWTHere", "MUIVerb")
81+
82+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin", "Extended")
83+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin", "HasLUAShield")
84+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin", "Icon")
85+
&& xRegistry.TestRegValuePresense(@"HKEY_CLASSES_ROOT\Directory\shell\OpenWTHereAsAdmin", "MUIVerb"))
86+
{
87+
Terminal_Integration_ToggleButton.Checked -= Terminal_Integration_ToggleButton_Handler;
88+
Terminal_Integration_ToggleButton.IsChecked = true;
89+
Terminal_Integration_ToggleButton.Checked += Terminal_Integration_ToggleButton_Handler;
90+
}
91+
}
92+
}
93+
}

0 commit comments

Comments
 (0)