From 0c42af80437b09a4b8c588d1ffdcdd5e007f5189 Mon Sep 17 00:00:00 2001 From: Mahdi Hosseini Date: Sun, 1 Dec 2024 15:49:04 +0330 Subject: [PATCH] refactor vsix --- .../Common/NugetClientHelper.cs | 8 ++--- .../Common/Options/GlobalUsingOption.cs | 2 +- .../Common/PreDefinedLibrary.cs | 6 ++-- .../Common/PredefinedCodes.cs | 2 +- .../DevWinUI_Template/Common/WizardConfig.cs | 2 +- .../DevWinUI_TemplatePackage.cs | 4 +-- .../TemplateWizard/SharedWizard.cs | 15 +++++----- .../WinUIAppBlankUnitTestWizard.cs | 6 ++-- .../TemplateWizard/WinUIAppBlankWizard.cs | 6 ++-- .../WinUIAppMVVMNavigationWizard.cs | 14 ++++----- .../TemplateWizard/WinUIAppMVVMWizard.cs | 12 ++++---- .../WinUIAppNavigationWizard.cs | 30 +++++++++---------- .../TemplateWizard/WinUIAppWizard.cs | 12 ++++---- .../Views/MainWindow.xaml.cs | 12 ++++---- .../source.extension.vsixmanifest | 2 +- 15 files changed, 63 insertions(+), 70 deletions(-) diff --git a/VSIX/DevWinUI_Template/DevWinUI_Template/Common/NugetClientHelper.cs b/VSIX/DevWinUI_Template/DevWinUI_Template/Common/NugetClientHelper.cs index e43686f..c834778 100644 --- a/VSIX/DevWinUI_Template/DevWinUI_Template/Common/NugetClientHelper.cs +++ b/VSIX/DevWinUI_Template/DevWinUI_Template/Common/NugetClientHelper.cs @@ -1,12 +1,12 @@ -using NuGet.Common; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using NuGet.Common; using NuGet.Configuration; using NuGet.Packaging.Core; using NuGet.Protocol; using NuGet.Protocol.Core.Types; using NuGet.Versioning; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; namespace DevWinUI_Template { diff --git a/VSIX/DevWinUI_Template/DevWinUI_Template/Common/Options/GlobalUsingOption.cs b/VSIX/DevWinUI_Template/DevWinUI_Template/Common/Options/GlobalUsingOption.cs index 7cff247..4dc37cf 100644 --- a/VSIX/DevWinUI_Template/DevWinUI_Template/Common/Options/GlobalUsingOption.cs +++ b/VSIX/DevWinUI_Template/DevWinUI_Template/Common/Options/GlobalUsingOption.cs @@ -10,7 +10,7 @@ public class GlobalUsingOption public GlobalUsingOption(Dictionary replacementsDictionary, string safeProjectName, bool fileLogger, bool debugLogger) { StringBuilder outputBuilder = new StringBuilder(); - + if (WizardConfig.UseJsonSettings) { outputBuilder.AppendLine(Environment.NewLine + $"global using static {safeProjectName}.Common.AppHelper;"); diff --git a/VSIX/DevWinUI_Template/DevWinUI_Template/Common/PreDefinedLibrary.cs b/VSIX/DevWinUI_Template/DevWinUI_Template/Common/PreDefinedLibrary.cs index 2cac25b..ba18526 100644 --- a/VSIX/DevWinUI_Template/DevWinUI_Template/Common/PreDefinedLibrary.cs +++ b/VSIX/DevWinUI_Template/DevWinUI_Template/Common/PreDefinedLibrary.cs @@ -23,7 +23,7 @@ public class Library public bool IsSelected { get; set; } public Library() { - + } public Library(string name, string version, string net9Version, Group group, bool includePreRelease = false) { @@ -37,7 +37,7 @@ public Library(string name, string version, string net9Version, Group group, boo public Library(string name, Group group, bool includePreRelease = false) { Name = name; - Group= group; + Group = group; IncludePreRelease = includePreRelease; Net9Version = null; Version = null; @@ -45,7 +45,7 @@ public Library(string name, Group group, bool includePreRelease = false) public Library(string name, bool includePreRelease = false) { Name = name; - Group= Group.None; + Group = Group.None; IncludePreRelease = includePreRelease; Net9Version = null; Version = null; diff --git a/VSIX/DevWinUI_Template/DevWinUI_Template/Common/PredefinedCodes.cs b/VSIX/DevWinUI_Template/DevWinUI_Template/Common/PredefinedCodes.cs index b183dc9..b9e157b 100644 --- a/VSIX/DevWinUI_Template/DevWinUI_Template/Common/PredefinedCodes.cs +++ b/VSIX/DevWinUI_Template/DevWinUI_Template/Common/PredefinedCodes.cs @@ -41,7 +41,7 @@ public static class PredefinedCodes await menuService.SaveAsync(menu); } """"; - + public static readonly string SettingsCardCommentCode = """