Hello Jose,
I use an unbound template thatuses a recipe to fill the replacement dictionnary. So here is the .vstemplate :
BusinessComponent.vstemplate
--------------------------------------------------------------------------------
<VSTemplate Version="2.0.0" xmlns="http:/schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<Name>Ajouter un Manager</Name>
<Description>Creation d'un Manager pour une entite (EntityManager)</Description>
<Icon Package="{FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}" ID="4515" />
<ProjectType>CSharp</ProjectType>
<SortOrder>20</SortOrder>
<DefaultName>N'entrez rien ici</DefaultName>
</TemplateData>
<TemplateContent>
<References>
<Reference>
<Assembly>System</Assembly>
</Reference>
<Reference>
<Assembly>System.Data</Assembly>
</Reference>
<Reference>
<Assembly>System.Xml</Assembly>
</Reference>
</References>
<ProjectItem OpenInEditor="true" SubType="Code" TargetFileName="$SingularEntityName$Manager.cs" ReplaceParameters="true">EntityManager.cs</ProjectItem>
</TemplateContent>
<WizardExtension>
<Assembly>Microsoft.Practices.RecipeFramework.VisualStudio, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>
<FullClassName>Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate</FullClassName>
</WizardExtension>
<WizardData>
<Template xmlns="http:/schemas.microsoft.com/pag/gax-template"
SchemaVersion="1.0"
Recipe="AddBusinessComponentRecipe"/>
</WizardData>
</VSTemplate>
--------------------------------------------------------------------------------
And here is the recipe (I removed some arguments to make it clear, but the effect is the same) :
<Recipe Name="AddBusinessComponentRecipe" Bound="false">
<Caption>Add a manager</Caption>
<HostData>
<Icon ID="1429"/>
<CommandBar Name="Project"/>
<CommandBar Name="Project Add"/>
<CommandBar Name="Folder"/>
</HostData>
<Arguments>
<!-- User Input -->
<Argument Name="DevelopperName">
<ValueProvider Type="FrameworkGuidancePackage.ValueProviders.DefaultValueProvider, FrameworkGuidancePackage"/>
</Argument>
<Argument Name="SingularEntityName">
</Argument>
<Argument Name="PlurialEntityName">
<ValueProvider Type="FrameworkGuidancePackage.ValueProviders.PlurialValueProvider, FrameworkGuidancePackage">
<MonitorArgument Name="SingularEntityName"/>
</ValueProvider>
</Argument>
<!-- Derived Arguments -->
<Argument Name="LowerSingularEntityName">
<ValueProvider Type="FrameworkGuidancePackage.ValueProviders.LowerEntityNameValueProvider2, FrameworkGuidancePackage" Expression="$(SingularEntityName)">
<MonitorArgument Name="SingularEntityName"/>
</ValueProvider>
</Argument>
<Argument Name="LowerPlurialEntityName">
<ValueProvider Type="FrameworkGuidancePackage.ValueProviders.LowerEntityNameValueProvider, FrameworkGuidancePackage">
<MonitorArgument Name="PlurialEntityName"/>
</ValueProvider>
</Argument>
</Arguments>
<GatheringServiceData>
<Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
<Pages>
<Page>
<Title>Création d'un nouveau Manager</Title>
<Fields>
<Field ValueName="DevelopperName" Label="Nom du développeur :" />
<Field ValueName="SingularEntityName" Label="Nom de l'entité (Ex: Invoice) :" />
<Field ValueName="PlurialEntityName" Label="Nom de l'entité au pluriel (Ex: Invoices) :" />
</Fields>
</Page>
</Pages>
</Wizard>
</GatheringServiceData>
</Recipe>
So if my comprehension is good, it's the template that calls the recipe. The wizard then shows up. I fill the 3 values and when I click on finish, the template is unfolded by the VS2005 template engine and my replacement values get replaced.
But thevalues that monitors other values seems to have problem in the replacement.
Here is an example of what gets replaced :
Values filled in the wizard :
- DevelopperName : Philippe
- SingularEntityName : Test
- PlurialEntityName : Tests
What should be remplaced in the template :
- DevelopperName : Philippe
- SingularEntityName : Test
- PlurialEntityName : Tests
- LowerSingularEntityName : test
- LowerPlurialEntityName : tests
Values that are actually replaced in the template :
- DevelopperName : Philippe
- SingularEntityName : Test
- PlurialEntityName : Ts
- LowerSingularEntityName : -- (the token is not replaced)
- LowerPlurialEntityName : -- (the token is not replaced)
If you need more info, just tell me!
Thank you for your help!
Phil