From 5866c6f6db9fa2c2249e886cb2fe9df227c1d70d Mon Sep 17 00:00:00 2001 From: oZ-Zo <50652175+oz-zo@users.noreply.github.com> Date: Fri, 15 Nov 2019 17:06:02 +0300 Subject: [PATCH] Change "Save" "Load" and "Apply" buttons behavior :tada: --- VS/Script_Gui/Script_Gui.sln | 6 - VS/Script_Gui/Script_Gui_3/MainWindow.xaml | 169 ++++++++++++++---- Win-10-Setup-Script-GUI-2.ps1 | 193 ++++++++++++++++----- 3 files changed, 281 insertions(+), 87 deletions(-) diff --git a/VS/Script_Gui/Script_Gui.sln b/VS/Script_Gui/Script_Gui.sln index 52b8df50..387c981a 100644 --- a/VS/Script_Gui/Script_Gui.sln +++ b/VS/Script_Gui/Script_Gui.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 15.0.28307.757 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Script_Gui", "Script_Gui\Script_Gui.csproj", "{84E3C0BF-8F95-4727-B6B2-9228DF8C1AE0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Script_Gui_List", "Script_Gui_List\Script_Gui_List.csproj", "{8D4B93DB-6238-49AF-9B22-85C35A5491BF}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Script_Gui_3", "Script_Gui_3\Script_Gui_3.csproj", "{45E68285-3CAC-44DE-8647-A172F7168335}" EndProject Global @@ -19,10 +17,6 @@ Global {84E3C0BF-8F95-4727-B6B2-9228DF8C1AE0}.Debug|Any CPU.Build.0 = Debug|Any CPU {84E3C0BF-8F95-4727-B6B2-9228DF8C1AE0}.Release|Any CPU.ActiveCfg = Release|Any CPU {84E3C0BF-8F95-4727-B6B2-9228DF8C1AE0}.Release|Any CPU.Build.0 = Release|Any CPU - {8D4B93DB-6238-49AF-9B22-85C35A5491BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D4B93DB-6238-49AF-9B22-85C35A5491BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D4B93DB-6238-49AF-9B22-85C35A5491BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D4B93DB-6238-49AF-9B22-85C35A5491BF}.Release|Any CPU.Build.0 = Release|Any CPU {45E68285-3CAC-44DE-8647-A172F7168335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {45E68285-3CAC-44DE-8647-A172F7168335}.Debug|Any CPU.Build.0 = Debug|Any CPU {45E68285-3CAC-44DE-8647-A172F7168335}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/VS/Script_Gui/Script_Gui_3/MainWindow.xaml b/VS/Script_Gui/Script_Gui_3/MainWindow.xaml index 450788f0..ef115270 100644 --- a/VS/Script_Gui/Script_Gui_3/MainWindow.xaml +++ b/VS/Script_Gui/Script_Gui_3/MainWindow.xaml @@ -99,45 +99,35 @@ - - - + + + + + + + + + + - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + diff --git a/Win-10-Setup-Script-GUI-2.ps1 b/Win-10-Setup-Script-GUI-2.ps1 index a01f1ef4..4d3d1166 100644 --- a/Win-10-Setup-Script-GUI-2.ps1 +++ b/Win-10-Setup-Script-GUI-2.ps1 @@ -406,45 +406,35 @@ $TextRu = "Добавить пункт ""Extract"" для MSI в контекс - - - + + + + + + + + + + - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + @@ -4240,14 +4333,14 @@ function Click-ToggleButton { if ($clickedToggle -gt 0) { - $ButtonApply.Visibility = "Visible" - $ButtonSave.Visibility = "Visible" + $ButtonApply.IsEnabled = $true + $ButtonSave.IsEnabled = $true } else { - $ButtonApply.Visibility = "Hidden" - $ButtonSave.Visibility = "Hidden" + $ButtonApply.IsEnabled = $false + $ButtonSave.IsEnabled = $false } } @@ -4263,7 +4356,7 @@ function Set-Language { [Parameter(Mandatory=$false)] [switch]$Change ) - + (Get-Variable -Name "Text_*").Name | ForEach-Object { $textToggle = $Window.FindName($_) @@ -4299,6 +4392,20 @@ function Set-Language { { $Global:RU = !$RU } + + if ($RU) + { + $TextButtonApply.Text = "Применить" + $TextButtonSave.Text = "Сохранить" + $TextButtonLoad.Text = "Загрузить" + } + + else + { + $TextButtonApply.Text = "Apply" + $TextButtonSave.Text = "Save" + $TextButtonLoad.Text = "Load" + } } function Follow-OnGitHub {