In Visual Studio 2005, 2008, and 2010, is it possible to define an Item Template that only appears in the Add Item dialog for projects of a particular ProjectFlavor? I'd rather not clutter all of the other unrelated projects' Add Items dialog if I can help it.
Seems that the <ProjectType>CSharp</ProjectType>
is a fixed enumeration and I can't find any place for a ProjectFlavor guid or otherwise.
I don't see any examples of other products showing such restraint, but I want to make sure.
=====
OK, Aaron's tip is very promising but my first attempt is unsuccessful.
In the .vstemplate:
<TemplateData>
<Name>MyProject A File</Name>
<Description>MyProject A File to do stuff</Description>
<Icon>A.ico</Icon>
<TemplateID>TemplateID_A</TemplateID>
<TemplateGroupID>MyTemplateGroupID</TemplateGroupID>
<ProjectType>CSharp</ProjectType>
<RequiredFrameworkVersion>2.0</RequiredFrameworkVersion>
<SortOrder>20</SortOrder>
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
<DefaultName>Template_A.cs</DefaultName>
<ProvideDefaultName>true</ProvideDefaultName>
<ShowByDefault>false</ShowByDefault>
</TemplateData>
<TemplateContent>
<ProjectItem ReplaceParameters="true">Template_A.cs</ProjectItem>
</TemplateContent>
And on the package.cs:
// [ProvideProjectItem(typeof(MyProjectFactory), "MyTemplateGroupID",
// @"Templates\ProjectItems", 600)] // Took this out.
[ProvideProjectFactory(typeof(MyProjectFactory),
"My Project", "My Project Files (*.csproj);*.csproj",
null, null, @"Templates\Projects",
LanguageVsTemplate = "CSharp",
NewProjectRequireNewFolderVsTemplate = true,
TemplateGroupIDsVsTemplate="MyTemplateGroupID",
TemplateIDsVsTemplate = "TemplateID_A,TemplateID_B")]
public sealed class MyPackage : Package { ... }