Skip to content

Commit

Permalink
simplify RunStarted in VSIX
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Dec 6, 2024
1 parent 2451fff commit 5cfb6f7
Show file tree
Hide file tree
Showing 9 changed files with 265 additions and 252 deletions.
476 changes: 240 additions & 236 deletions VSIX/DevWinUI_Template/DevWinUI_Template/TemplateWizard/SharedWizard.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace DevWinUI_Template;
public class TemplateConfig
{
public bool IsMVVM { get; set; }
public bool HasNavigationView { get; set; }
public bool IsBlank { get; set; }
public bool IsTest { get; set; }
public bool HasPages { get; set; }
public TemplateType TemplateType { get; set; }
}
public enum TemplateType
{
WinUIApp_Blank_UnitTest,
WinUIApp_Blank,
WinUIApp_MVVM_NavigationView,
WinUIApp_MVVM,
WinUIApp_NavigationView,
WinUIApp
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void RunFinished()
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
WizardImplementation = new SharedWizard();
WizardImplementation.RunStarted(automationObject, replacementsDictionary, "WinUIApp-Blank-UnitTest", false, false, false, true, true);
WizardImplementation.RunStarted(automationObject, replacementsDictionary, new TemplateConfig { IsBlank = true, IsTest = true, TemplateType = TemplateType.WinUIApp_Blank_UnitTest });
}

public bool ShouldAddProjectItem(string filePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void RunFinished()
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
WizardImplementation = new SharedWizard();
WizardImplementation.RunStarted(automationObject, replacementsDictionary, "WinUIApp-Blank", false, false, false, true);
WizardImplementation.RunStarted(automationObject, replacementsDictionary, new TemplateConfig { IsBlank = true , TemplateType = TemplateType.WinUIApp_Blank });
}

public bool ShouldAddProjectItem(string filePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void RunFinished()
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
WizardImplementation = new SharedWizard();
WizardImplementation.RunStarted(automationObject, replacementsDictionary, "WinUIApp-MVVM-NavigationView", true, true, true);
WizardImplementation.RunStarted(automationObject, replacementsDictionary, new TemplateConfig { HasPages = true, IsMVVM = true, HasNavigationView = true, TemplateType = TemplateType.WinUIApp_MVVM_NavigationView });
}

public bool ShouldAddProjectItem(string filePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void RunFinished()
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
WizardImplementation = new SharedWizard();
WizardImplementation.RunStarted(automationObject, replacementsDictionary, "WinUIApp-MVVM", false, true);
WizardImplementation.RunStarted(automationObject, replacementsDictionary, new TemplateConfig { IsMVVM = true, TemplateType = TemplateType.WinUIApp_MVVM });
}

public bool ShouldAddProjectItem(string filePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void RunFinished()
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
WizardImplementation = new SharedWizard();
WizardImplementation.RunStarted(automationObject, replacementsDictionary, "WinUIApp-NavigationView", true, false, true);
WizardImplementation.RunStarted(automationObject, replacementsDictionary, new TemplateConfig { HasPages = true, HasNavigationView = true, TemplateType = TemplateType.WinUIApp_NavigationView });
}

public bool ShouldAddProjectItem(string filePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void RunFinished()
public void RunStarted(object automationObject, Dictionary<string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
{
WizardImplementation = new SharedWizard();
WizardImplementation.RunStarted(automationObject, replacementsDictionary, "WinUIApp", false);
WizardImplementation.RunStarted(automationObject, replacementsDictionary, new TemplateConfig { TemplateType = TemplateType.WinUIApp });
}

public bool ShouldAddProjectItem(string filePath)
Expand Down

0 comments on commit 5cfb6f7

Please sign in to comment.