Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
-refactoring -reboot window
Greedeks379de910fbe2
diff --git a/.Source/GTweak/GTweak.csproj b/.Source/GTweak/GTweak.csprojindex 39d0635f..599eaf5a 100644--- a/.Source/GTweak/GTweak.csproj+++ b/.Source/GTweak/GTweak.csproj@@ -275,6 +275,9 @@<Compile Include="Windows\NotificationWindow.xaml.cs"><DependentUpon>NotificationWindow.xaml</DependentUpon></Compile>+ <Compile Include="Windows\RebootWindow.xaml.cs">+ <DependentUpon>RebootWindow.xaml</DependentUpon>+ </Compile><Compile Include="Windows\WaitingWindow.xaml.cs"><DependentUpon>WaitingWindow.xaml</DependentUpon></Compile>@@ -440,6 +443,10 @@<SubType>Designer</SubType><Generator>MSBuild:Compile</Generator></Page>+ <Page Include="Windows\RebootWindow.xaml">+ <SubType>Designer</SubType>+ <Generator>MSBuild:Compile</Generator>+ </Page><Page Include="Windows\WaitingWindow.xaml"><SubType>Designer</SubType><Generator>MSBuild:Compile</Generator>diff --git a/.Source/GTweak/Languages/en/Lang.xaml b/.Source/GTweak/Languages/en/Lang.xamlindex b6967e7a..11da017c 100644--- a/.Source/GTweak/Languages/en/Lang.xaml+++ b/.Source/GTweak/Languages/en/Lang.xaml@@ -92,7 +92,11 @@<v:String x:Key="wait_win_import">It takes some time</v:String><v:String x:Key="warning_win_import">It is not necessary to close the window forcibly</v:String><!--#endregion-->-++ <!--#region Reboot Window -->+ <v:String x:Key="title_reboot">Attention GTweak reboot</v:String>+ <!--#endregion-->+<!--#region Confidentiality Page --><v:String x:Key="tgl1_confidentiality">Advertising identifier and targeted advertising</v:String><v:String x:Key="tgl2_confidentiality">All types of syncing your data</v:String>diff --git a/.Source/GTweak/Languages/ru/Lang.xaml b/.Source/GTweak/Languages/ru/Lang.xamlindex 9065ff6e..cdc38836 100644--- a/.Source/GTweak/Languages/ru/Lang.xaml+++ b/.Source/GTweak/Languages/ru/Lang.xaml@@ -93,6 +93,10 @@<v:String x:Key="warning_win_import">Не стоит закрывать окно насильно</v:String><!--#endregion-->+ <!--#region Reboot Window -->+ <v:String x:Key="title_reboot">Внимание перезагрузка GTweak</v:String>+ <!--#endregion-->+<!--#region Confidentiality Page --><v:String x:Key="tgl1_confidentiality">Рекламный идентификатор и таргетированная реклама</v:String><v:String x:Key="tgl2_confidentiality">Все типы синхронизация ваших данных</v:String>diff --git a/.Source/GTweak/Utilities/Settings.cs b/.Source/GTweak/Utilities/Settings.csindex 5651492d..620c1798 100644--- a/.Source/GTweak/Utilities/Settings.cs+++ b/.Source/GTweak/Utilities/Settings.cs@@ -198,7 +198,7 @@ namespace GTweak.Utilitiescatch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }}- internal static void SelfRestart()+ internal static void SelfReboot(){Process.Start(new ProcessStartInfo(){diff --git a/.Source/GTweak/Windows/ImportWindow.xaml b/.Source/GTweak/Windows/ImportWindow.xamlindex bf565492..d8f530f4 100644--- a/.Source/GTweak/Windows/ImportWindow.xaml+++ b/.Source/GTweak/Windows/ImportWindow.xaml@@ -8,8 +8,8 @@mc:Ignorable="d"Title="GTweak" WindowStyle="None"Height="180" Width="450" MinHeight="180" MinWidth="450" MaxHeight="200" MaxWidth="350"- Background="Transparent" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Topmost="True" ResizeMode="CanMinimize"- ShowInTaskbar="False" IsTabStop="False" Loaded="Window_Loaded">+ Background="Transparent" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Topmost="True" ResizeMode="CanMinimize"+ ShowInTaskbar="False" IsTabStop="False" Loaded="Window_Loaded"><Window.DataContext><vm:MainViewModel/></Window.DataContext>diff --git a/.Source/GTweak/Windows/LoadingWindow.xaml.cs b/.Source/GTweak/Windows/LoadingWindow.xaml.csindex 527dfe7d..5137b81f 100644--- a/.Source/GTweak/Windows/LoadingWindow.xaml.cs+++ b/.Source/GTweak/Windows/LoadingWindow.xaml.cs@@ -86,7 +86,7 @@ namespace GTweak.WindowsClosing -= Window_Closing;e.Cancel = true;DoubleAnimation doubleAnim = new DoubleAnimation(0, TimeSpan.FromSeconds(0.1));- doubleAnim.Completed += (s, _) => this.Close();+ doubleAnim.Completed += delegate { this.Close(); };this.BeginAnimation(OpacityProperty, doubleAnim);}}diff --git a/.Source/GTweak/Windows/MainWindow.xaml.cs b/.Source/GTweak/Windows/MainWindow.xaml.csindex 6744a9ee..6ccd677f 100644--- a/.Source/GTweak/Windows/MainWindow.xaml.cs+++ b/.Source/GTweak/Windows/MainWindow.xaml.cs@@ -1,5 +1,6 @@using GTweak.Utilities;using GTweak.Utilities.Tweaks;+using GTweak.Windows;using System;using System.ComponentModel;using System.Diagnostics;@@ -29,7 +30,7 @@ namespace GTweak_ => 2,};App.ImportTweaksUpdate += delegate { BtnMore.IsChecked = true; };- App.ThemeChanged += delegate { Settings.SelfRestart(); };+ App.ThemeChanged += delegate { new RebootWindow().ShowDialog(); };}#region Button Title/Animation Window@@ -107,7 +108,7 @@ namespace GTweakClosing -= Window_Closing;e.Cancel = true;DoubleAnimation doubleAnim = new DoubleAnimation(0, (Duration)TimeSpan.FromSeconds(0.1));- doubleAnim.Completed += (s, _) => { this.Close(); };+ doubleAnim.Completed += delegate { this.Close(); };Timeline.SetDesiredFrameRate(doubleAnim, 400);BeginAnimation(OpacityProperty, doubleAnim);}diff --git a/.Source/GTweak/Windows/MessageWindow.xaml.cs b/.Source/GTweak/Windows/MessageWindow.xaml.csindex b4dfa252..aa04e9d7 100644--- a/.Source/GTweak/Windows/MessageWindow.xaml.cs+++ b/.Source/GTweak/Windows/MessageWindow.xaml.cs@@ -55,7 +55,7 @@ namespace GTweak.WindowsClosing -= Window_Closing;e.Cancel = true;DoubleAnimation doubleAnim = new DoubleAnimation(0, TimeSpan.FromSeconds(0.1));- doubleAnim.Completed += (s, _) => { timer.Stop(); Application.Current.Shutdown(); };+ doubleAnim.Completed += delegate { timer.Stop(); Application.Current.Shutdown(); };Timeline.SetDesiredFrameRate(doubleAnim, 400);BeginAnimation(OpacityProperty, doubleAnim);}diff --git a/.Source/GTweak/Windows/NotificationWindow.xaml.cs b/.Source/GTweak/Windows/NotificationWindow.xaml.csindex c7c44ab8..457cbfd3 100644--- a/.Source/GTweak/Windows/NotificationWindow.xaml.cs+++ b/.Source/GTweak/Windows/NotificationWindow.xaml.cs@@ -130,7 +130,7 @@ namespace GTweak.WindowsClosing -= Window_Closing;e.Cancel = true;DoubleAnimation doubleAnimation = new DoubleAnimation(0, TimeSpan.FromSeconds(0.1));- doubleAnimation.Completed += (s, _) => { Close(); };+ doubleAnimation.Completed += delegate { Close(); };Timeline.SetDesiredFrameRate(doubleAnimation, 400);BeginAnimation(OpacityProperty, doubleAnimation);}diff --git a/.Source/GTweak/Windows/RebootWindow.xaml b/.Source/GTweak/Windows/RebootWindow.xamlnew file mode 100644index 00000000..fdf5520e--- /dev/null+++ b/.Source/GTweak/Windows/RebootWindow.xaml@@ -0,0 +1,31 @@+<Window x:Class="GTweak.Windows.RebootWindow"+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"+ xmlns:local="clr-namespace:GTweak.Windows"+ xmlns:xrpb="http://XamlRadialProgressBar/DotNet"+ mc:Ignorable="d"+ Title="GTweak" WindowStyle="None"+ Height="200" Width="200"+ Background="Transparent" AllowsTransparency="True" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" SnapsToDevicePixels="True" UseLayoutRounding="True"+ IsTabStop="False" Opacity="0.98" Topmost="True" ShowInTaskbar="False" Loaded="Window_Loaded">+ <Grid>+ <Ellipse Height="140" Width="140" Fill="{StaticResource Color_Background_Dark}" StrokeThickness="6.6" VerticalAlignment="Center" HorizontalAlignment="Center"/>+ <Ellipse Height="160" Width="160" Stroke="{StaticResource Color_Background_RadialProgressBar}" StrokeThickness="6.6" VerticalAlignment="Center" HorizontalAlignment="Center"/>++ <xrpb:RadialProgressBar x:Name="RestartProgress" Value="10" Maximum="100" Width="170" Height="170" ArcWidth="6" VerticalAlignment="Center" HorizontalAlignment="Center">+ <xrpb:RadialProgressBar.Foreground>+ <LinearGradientBrush EndPoint="0,0.3" StartPoint="0.9,0" ColorInterpolationMode="ScRgbLinearInterpolation" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad">+ <GradientStop Color="{StaticResource Color_Border_Gradient_2}" Offset="0.7"/>+ <GradientStop Color="{StaticResource Color_Border_Gradient_1}" Offset="0.4"/>+ </LinearGradientBrush>+ </xrpb:RadialProgressBar.Foreground>+ <xrpb:RadialProgressBar.Effect>+ <DropShadowEffect BlurRadius="30" ShadowDepth="1" Direction="-90" Color="{StaticResource Color_Shadow}"/>+ </xrpb:RadialProgressBar.Effect>+ </xrpb:RadialProgressBar>++ <TextBlock Text="{DynamicResource title_reboot}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource Color_TetBlock_Inactivity}" Height="auto" Width="130" TextAlignment="Center" Style="{StaticResource Text}"/>+ </Grid>+</Window>diff --git a/.Source/GTweak/Windows/RebootWindow.xaml.cs b/.Source/GTweak/Windows/RebootWindow.xaml.csnew file mode 100644index 00000000..0cf759e3--- /dev/null+++ b/.Source/GTweak/Windows/RebootWindow.xaml.cs@@ -0,0 +1,30 @@+using GTweak.Utilities;+using System;+using System.Windows;+using System.Windows.Controls;+using System.Windows.Media.Animation;++namespace GTweak.Windows+{+ public partial class RebootWindow : Window+ {+ public RebootWindow()+ {+ InitializeComponent();+ }++ private void Window_Loaded(object sender, RoutedEventArgs e)+ {+ DoubleAnimation doubleAnim = new DoubleAnimation()+ {+ From = 0,+ To = 100,+ EasingFunction = new QuadraticEase(),+ Duration = TimeSpan.FromSeconds(1.5)+ };+ Timeline.SetDesiredFrameRate(doubleAnim, 400);+ doubleAnim.Completed += delegate { Settings.SelfReboot(); };+ RestartProgress.BeginAnimation(ProgressBar.ValueProperty, doubleAnim);+ }+ }+}diff --git a/.Source/GTweak/Windows/WaitingWindow.xaml.cs b/.Source/GTweak/Windows/WaitingWindow.xaml.csindex 73d89fa1..72166a26 100644--- a/.Source/GTweak/Windows/WaitingWindow.xaml.cs+++ b/.Source/GTweak/Windows/WaitingWindow.xaml.cs@@ -24,7 +24,7 @@ namespace GTweak.WindowsClosing -= Window_Closing;e.Cancel = true;DoubleAnimation doubleAnim = new DoubleAnimation(0, (Duration)TimeSpan.FromSeconds(0.15));- doubleAnim.Completed += (s, _) =>+ doubleAnim.Completed += delegate{ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;disablingWinKeys.objKeyboardProcess = new DisablingWinKeys.LowLevelKeyboardProc(disablingWinKeys.CaptureKey);