ShowByDefault(Visual Studio 模板)

如果为 true,则指定此模板将只显示在指定的 TemplateGroupID 下。

<ShowByDefault> true/false </ShowByDefault>

特性和元素

以下几节描述了属性、子元素和父元素。

特性

无。

子元素

无。

父元素

元素

说明

TemplateData

将此模板分类并定义此模板在“新建项目”“添加新项”对话框中的显示方式。

文本值

需要一个文本值。

此文本必须是 true 或 false。 如果为 True,则指定此模板将只显示在指定的 TemplateGroupID 下。

备注

ShowByDefault 是可选元素。 默认为 true。

示例

下面的示例演示 Visual C# 模板的元数据。

<VSTemplate Type="Project" Version="2.0.0"
    xmlns="https://schemas.microsoft.com/developer/vstemplate/2005">
    <TemplateData>
        <Name>My template</Name>
        <Description>A basic template</Description>
        <Icon>TemplateIcon.ico</Icon>
        <ProjectType>CSharp</ProjectType>
        <ShowByDefault>false</ShowByDefault>
    </TemplateData>
    <TemplateContent>
        <Project File="MyTemplate.csproj">
            <ProjectItem>Form1.cs<ProjectItem>
            <ProjectItem>Form1.Designer.cs</ProjectItem>
            <ProjectItem>Program.cs</ProjectItem>
            <ProjectItem>Properties\AssemblyInfo.cs</ProjectItem>
            <ProjectItem>Properties\Resources.resx</ProjectItem>
            <ProjectItem>Properties\Resources.Designer.cs</ProjectItem>
            <ProjectItem>Properties\Settings.settings</ProjectItem>
            <ProjectItem>Properties\Settings.Designer.cs</ProjectItem>
        </Project>
    </TemplateContent>
</VSTemplate>

请参见

参考

Visual Studio 模板架构参考

TemplateGroupID 元素(Visual Studio 模板)

其他资源

Visual Studio 模板