CustomParameters 元素(Visual Studio 模板)

当模板向导进行参数替换时,对要传递给模板向导的自定义参数进行分组。

<CustomParameters>
    <CustomParameter/>
    <CustomParameter/>
</CustomParameters>

特性和元素

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

特性

无。

子元素

元素

说明

CustomParameter

可选元素。

包含从模板创建某个项目或项时要使用的自定义参数的名称和值。 CustomParameters 元素中可能有零个或多个 CustomParameter 元素。

父元素

元素

说明

TemplateContent

指定模板的内容。

示例

下面的示例演示如何在一个模板中使用多个自定义参数。 如果项目或项是使用下面的自定义参数从某个模板创建而成,则将模板文件中 $color1$ 和 $color2$ 的所有实例分别替换为 Red 和 Blue。

<CustomParameters>
    <CustomParameter Name="$color1$" Value="Red"/>
    <CustomParameter Name="$color2$" Value="Blue "/>
</CustomParameters>

请参见

参考

CustomParameter 元素(Visual Studio 模板)

Visual Studio 模板架构参考

概念

模板参数