diff --git a/VS/GUI-7/App.config b/VS/GUI-7/App.config new file mode 100644 index 00000000..8e156463 --- /dev/null +++ b/VS/GUI-7/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/VS/GUI-7/App.xaml b/VS/GUI-7/App.xaml new file mode 100644 index 00000000..a5ea2946 --- /dev/null +++ b/VS/GUI-7/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/VS/GUI-7/App.xaml.cs b/VS/GUI-7/App.xaml.cs new file mode 100644 index 00000000..136cbcb4 --- /dev/null +++ b/VS/GUI-7/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace GUI_7 +{ + /// + /// Логика взаимодействия для App.xaml + /// + public partial class App : Application + { + } +} diff --git a/VS/GUI-7/GUI-7.csproj b/VS/GUI-7/GUI-7.csproj new file mode 100644 index 00000000..0547e4d2 --- /dev/null +++ b/VS/GUI-7/GUI-7.csproj @@ -0,0 +1,97 @@ + + + + + Debug + AnyCPU + {B14102D2-B716-4B49-898D-FBACA3C68810} + WinExe + GUI_7 + GUI-7 + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + \ No newline at end of file diff --git a/VS/GUI-7/MainWindow.xaml b/VS/GUI-7/MainWindow.xaml new file mode 100644 index 00000000..6b310a20 --- /dev/null +++ b/VS/GUI-7/MainWindow.xaml @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VS/GUI-7/MainWindow.xaml.cs b/VS/GUI-7/MainWindow.xaml.cs new file mode 100644 index 00000000..30fcd33f --- /dev/null +++ b/VS/GUI-7/MainWindow.xaml.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace GUI_7 +{ + /// + /// Логика взаимодействия для MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + + private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + DragMove(); + } + } +} diff --git a/VS/GUI-7/Properties/AssemblyInfo.cs b/VS/GUI-7/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..c4dff23b --- /dev/null +++ b/VS/GUI-7/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, +// связанные со сборкой. +[assembly: AssemblyTitle("GUI-7")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("GUI-7")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// COM, задайте атрибуту ComVisible значение TRUE для этого типа. +[assembly: ComVisible(false)] + +//Чтобы начать создание локализуемых приложений, задайте +//CultureYouAreCodingWith в файле .csproj +//внутри . Например, если используется английский США +//в своих исходных файлах установите в en-US. Затем отмените преобразование в комментарий +//атрибута NeutralResourceLanguage ниже. Обновите "en-US" в +//строка внизу для обеспечения соответствия настройки UICulture в файле проекта. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //где расположены словари ресурсов по конкретным тематикам + //(используется, если ресурс не найден на странице, + // или в словарях ресурсов приложения) + ResourceDictionaryLocation.SourceAssembly //где расположен словарь универсальных ресурсов + //(используется, если ресурс не найден на странице, + // в приложении или в каких-либо словарях ресурсов для конкретной темы) +)] + + +// Сведения о версии сборки состоят из следующих четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Редакция +// +// Можно задать все значения или принять номер сборки и номер редакции по умолчанию. +// используя "*", как показано ниже: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VS/GUI-7/Properties/Resources.Designer.cs b/VS/GUI-7/Properties/Resources.Designer.cs new file mode 100644 index 00000000..0e245fa8 --- /dev/null +++ b/VS/GUI-7/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программным средством. +// Версия среды выполнения: 4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если +// код создан повторно. +// +//------------------------------------------------------------------------------ + +namespace GUI_7.Properties +{ + + + /// + /// Класс ресурсов со строгим типом для поиска локализованных строк и пр. + /// + // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder + // класс с помощью таких средств, как ResGen или Visual Studio. + // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen + // с параметром /str или заново постройте свой VS-проект. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GUI_7.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Переопределяет свойство CurrentUICulture текущего потока для всех + /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/VS/GUI-7/Properties/Resources.resx b/VS/GUI-7/Properties/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/VS/GUI-7/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/VS/GUI-7/Properties/Settings.Designer.cs b/VS/GUI-7/Properties/Settings.Designer.cs new file mode 100644 index 00000000..80f3bbee --- /dev/null +++ b/VS/GUI-7/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GUI_7.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/VS/GUI-7/Properties/Settings.settings b/VS/GUI-7/Properties/Settings.settings new file mode 100644 index 00000000..033d7a5e --- /dev/null +++ b/VS/GUI-7/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/VS/Windows-10-Setup-Script/Windows-10-Setup-Script.sln b/VS/Windows-10-Setup-Script/Windows-10-Setup-Script.sln index fe977be6..565b174b 100644 --- a/VS/Windows-10-Setup-Script/Windows-10-Setup-Script.sln +++ b/VS/Windows-10-Setup-Script/Windows-10-Setup-Script.sln @@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GUI-4", "..\GUI-4\GUI-4.csp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GUI-6", "..\GUI-6\GUI-6.csproj", "{49C148DA-6EE8-4FAF-B7EE-A0D747649A25}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GUI-7", "..\GUI-7\GUI-7.csproj", "{B14102D2-B716-4B49-898D-FBACA3C68810}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,6 +47,10 @@ Global {49C148DA-6EE8-4FAF-B7EE-A0D747649A25}.Debug|Any CPU.Build.0 = Debug|Any CPU {49C148DA-6EE8-4FAF-B7EE-A0D747649A25}.Release|Any CPU.ActiveCfg = Release|Any CPU {49C148DA-6EE8-4FAF-B7EE-A0D747649A25}.Release|Any CPU.Build.0 = Release|Any CPU + {B14102D2-B716-4B49-898D-FBACA3C68810}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B14102D2-B716-4B49-898D-FBACA3C68810}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B14102D2-B716-4B49-898D-FBACA3C68810}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B14102D2-B716-4B49-898D-FBACA3C68810}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Win-10-Setup-Script-GUI-2.ps1 b/Win-10-Setup-Script-GUI-2.ps1 new file mode 100644 index 00000000..86aa0aa3 --- /dev/null +++ b/Win-10-Setup-Script-GUI-2.ps1 @@ -0,0 +1,287 @@ +Add-Type -AssemblyName "PresentationCore", "PresentationFramework", "WindowsBase" + +[xml]$xamlMarkup = @' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +'@ + +$xamlGui = [System.Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $xamlMarkup)) +$xamlMarkup.SelectNodes('//*[@Name]') | ForEach-Object { + New-Variable -Name $_.Name -Value $xamlGui.FindName($_.Name) + + # if ($_.Name.Contains("ToggleButton")) { + + # $ToggleBtn = $xamlGui.FindName($_.Name) + # [Void]$ToggleButtons.Add($ToggleBtn) + # } + + # else + # { + # New-Variable -Name $_.Name -Value $xamlGui.FindName($_.Name) + # } +} + +#region Script Functions +function Hide-Console { + <# + .SYNOPSIS + Hide Powershell console before show WPF GUI. + #> + + [CmdletBinding()] + param () + + Add-Type -Name Window -Namespace Console -MemberDefinition ' + [DllImport("Kernel32.dll")] + public static extern IntPtr GetConsoleWindow(); + + [DllImport("user32.dll")] + public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow); +' + [Console.Window]::ShowWindow([Console.Window]::GetConsoleWindow(), 0) +} + +#endregion + +#region Controls Events + +$Window.add_MouseLeftButtonDown( { + $Window.DragMove() + }) + +$ButtonTitleMin.add_MouseLeftButtonDown( { + $Window.WindowState = "Minimized" + }) + +$ButtonTitleMax.add_MouseLeftButtonDown( { + if ($Window.WindowState -eq "Normal") { + $Window.WindowState = "Maximized" + } + + else { + $Window.WindowState = "Normal" + } + }) + +$ButtonTitleClose.add_MouseLeftButtonDown( { + $Window.Close() + }) + +#endregion + +Hide-Console +$xamlGui.ShowDialog() | Out-Null \ No newline at end of file diff --git a/Win-10-Setup-Script-GUI.ps1 b/Win-10-Setup-Script-GUI.ps1 index 686668c2..99fd12a6 100644 --- a/Win-10-Setup-Script-GUI.ps1 +++ b/Win-10-Setup-Script-GUI.ps1 @@ -3860,17 +3860,18 @@ $xamlGui = [System.Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $xamlMarkup)) $xamlMarkup.SelectNodes('//*[@Name]') | ForEach-Object { + New-Variable -Name $_.Name -Value $xamlGui.FindName($_.Name) - if ($_.Name.Contains("ToggleButton")) { + # if ($_.Name.Contains("ToggleButton")) { - $ToggleBtn = $xamlGui.FindName($_.Name) - [Void]$ToggleButtons.Add($ToggleBtn) - } + # $ToggleBtn = $xamlGui.FindName($_.Name) + # [Void]$ToggleButtons.Add($ToggleBtn) + # } - else - { - New-Variable -Name $_.Name -Value $xamlGui.FindName($_.Name) - } + # else + # { + # New-Variable -Name $_.Name -Value $xamlGui.FindName($_.Name) + # } } #region Script Functions