CustomParameters Element (Visual Studio Templates)

Groups the custom parameters that are to be passed to the template wizard when the wizard makes parameter replacements.

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

特性和元素

The following sections describe attributes, child elements, and parent elements.

特性

None.

子元素

Element

Description

CustomParameter

Optional element.

Contains a custom parameter name and value to use when a project or item is created from the template. There may be zero or more CustomParameter elements in a CustomParameters element.

父元素

Element

Description

TemplateContent

Specifies the contents of the template.

示例

The following example shows how to use several custom parameters in a template. When a project or item is created from a template with the following custom parameters, all instances of $color1$ and $color2$ in the template files will be replaced with Red and Blue, respectively.

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

请参见

参考

CustomParameter 元素(Visual Studio 模板)

Visual Studio 模板架构参考

概念

模板参数