Skip to content

tpalacino/GlobalParams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GlobalParams

What is it?

An assembly that defines an implementation of the IWizard interface which provides all templates in a multi-project template with access to the parameters of the top level template.

How to use it?

  1. Ensure that the GlobalParams assembly is deployed to the GAC on any system that will use the template
  2. Modify all of the .vstemplate files in the multi-project template to include the WizardExtension element from this example
<VSTemplate Type="Project" Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
  <!-- VSTemplate required elements would be defined here. -->
  <WizardExtension>
    <Assembly>GlobalParams, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ea5a5299819fb7c0</Assembly>
    <FullClassName>GlobalParams.WizardMPT</FullClassName>
  </WizardExtension>
</VSTemplate>

How to use it with custom UI?

  1. Ensure that the GlobalParams assembly is deployed to the GAC on any system that will use the template

  2. Create a project that will define the wizard implementation

  3. Add a reference to the GlobalParams assembly

  4. Create a class and have it derive from GlobalParams.WizardMPT

  5. Override the OnBeforeRunStarted method

    1. Invoke the custom UI component
    2. Return true if the top level template parameters need to be accessible to all templates or false if they do not.
  6. Modify all of the .vstemplate files in the multi-project template to include a WizardExtension element that points to your wizard assembly and class.

Documentation

Overridable Methods

Method Summary
OnBeforeOpeningFile Invoked when the method BeforeOpeningFile is called by from Visual Studio
OnProjectFinishedGenerating Invoked when the method ProjectFinishedGenerating is called by from Visual Studio
OnProjectItemFinishedGenerating Invoked when the method ProjectItemFinishedGenerating is called by from Visual Studio
OnRunFinished Invoked when the method RunFinished is called by from Visual Studio
OnShouldAddProjectItem Invoked when the method ShouldAddProjectItem is called by from Visual Studio
OnBeforeRunStarted Invoked when the method RunStarted is called by from Visual Studio and before any modifications are made. If the returned Boolean value is false modifications will NOT be made.
OnAfterRunStarted Invoked immediately prior to exiting the RunStarted method.

Parameter List

IMPORTANT NOTE: Template parameters are case-sensitive.

Project Parameter Global Parameter Description
clrversion globalclrversion Current version of the common language runtime (CLR).
guid[1-10] globalguid[1-100] A Guid used to replace the project GUID in a project file. You can specify up to 100 unique GUIDs (e.g. $globalguid1$, $globalguid83$, etc.)
itemname globalitemname The name provided by the user in the Add New Item dialog box.
machinename globalmachinename The current computer name (for example, Computer01).
projectname globalprojectname The name provided by the user in the New Project dialog box.
registeredorganization globalregisteredorganization The registry key value from HKLM\Software\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization.
rootnamespace globalrootnamespace The root namespace of the current project. This parameter is used to replace the namespace only in an item being added to a project.
safeprojectname globalsafeprojectname The name provided by the user in the New Project dialog box, with all unsafe characters and spaces removed.
time globaltime The current time in the format DD/MM/YYYY 00:00:00.
userdomain globaluserdomain The current user domain.
username globalusername The current user name.
webnamespace globalwebnamespace The name of the current Web site. This parameter is used in the Web form template to guarantee unique class names. If the Web site is at the root directory of the Web server, this template parameter resolves to the root directory of the Web Server.
year globalyear The current year in the format YYYY.

About

Provides an extensible wizard implementation that exposes the parameters from the top level template to all templates in a multi-project template.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages