To use this IWizard implementation follow these steps:
  1. Ensure that this assembly is deployed to the GAC on any system that will use the template
  2. Modify all of the .vstemplate files in the template to include the WizardExtension element below
Version 1 Example
<WizardExtension>
  <Assembly>GlobalParams, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ea5a5299819fb7c0</Assembly>
  <FullClassName>GlobalParams.WizardMPT</FullClassName>
</WizardExtension>

Version 1.1 Example
<TemplateContent>
<!-- When using the MappedProjectTemplate configuration with GlobalParams do not include templates here -->
</TemplateContent>
<WizardExtension>
  <Assembly>GlobalParams, Version=1.1.0.0, Culture=neutral, PublicKeyToken=ea5a5299819fb7c0</Assembly>
  <FullClassName>GlobalParams.WizardMPT</FullClassName>
</WizardExtension>
<WizardData>
  <Settings>
    <MappedProjectTemplate name="$projectname$.Web" path="Web\$projectname$.Web" template="Web\$projectname$.Web.vstemplate" />
    <MappedProjectTemplate name="$projectname$.Shared" path="Shared\$projectname$.Shared" template="Shared\$projectname$.Shared.vstemplate" />
    <MappedProjectTemplate name="$projectname$.App" path="App\$projectname$.App" template="App\$projectname$.App.vstemplate" />
  </Settings>
</WizardData>

The above example creates the following structure on disk
TestSolution
^ TestSolution.sln
^ Web
^ TestSolution.Web
^ TestSolution.Web.proj
^ Shared
^ TestSolution.Shared
^ TestSolution.Shared.proj
^ App
^ TestSolution.App
^ TestSolution.App.proj
To define a user interface and leverage the global parameters follow these steps:
  1. Create a project that references this assembly
  2. Create an object that derives from GlobalParams.WizardMPT
  3. Override the methods required for your functionality
    • The "OnBeforeOpeningFile" method is invoked when the method "BeforeOpeningFile" is called by from Visual Studio
    • The "OnProjectFinishedGenerating" method is invoked when the method "ProjectFinishedGenerating" is called by from Visual Studio
    • The "OnProjectItemFinishedGenerating" method is invoked when the method "ProjectItemFinishedGenerating" is called by from Visual Studio
    • The "OnRunFinished" method is invoked when the method "RunFinished" is called by from Visual Studio
    • The "OnShouldAddProjectItem" method is invoked when the method "ShouldAddProjectItem" is called by from Visual Studio
    • The "OnBeforeRunStarted" method is invoked before any modifications are made. If the returned Boolean value is false modifications will NOT be made.
    • The "OnAfterRunStarted" method is invoked immediately prior to exiting the "RunStarted" method.

More Info:
How to: Use Wizards with Project Templates
How to: Create Multi-Project Templates
Template Parameters
Global Parameters - Complete List

Last edited Nov 18, 2013 at 2:55 AM by tpalacino, version 6

Comments

No comments yet.