Compartilhar via


Como: Criar modelos de Item para tipos específicos de projeto

The development environment enables you to make project items available from the Add Item dialog box for certain projects. Use este procedimento para disponibilizar itens personalizados para Windows, Web, Office ou projetos de banco de dados.

To display item templates for specific project types

  1. Locate the ProjectType element in the .vstemplate file for the item template.

  2. Add a ProjectSubType element immediately after the ProjectType element.

  3. Set the text value of the element to one of the following values:

    • Windows

    • Office

    • Database

    • Web

    For example:

    <ProjectSubType>Database</ProjectSubType>
    

Exemplo

The following example shows an item template available for Office projects.

<VSTemplate Version="2.0.0" Type="Item" Version="2.0.0">
    <TemplateData>
        <Name>Class</Name>
        <Description>An empty class file</Description>
        <Icon>Class.ico</Icon>
        <ProjectType>CSharp</ProjectType>
        <ProjectSubType>Office</ProjectSubType>
        <DefaultName>Class.cs</DefaultName>
    </TemplateData>
    <TemplateContent>
        <ProjectItem>Class1.cs</ProjectItem>
    </TemplateContent>
</VSTemplate>

Consulte também

Tarefas

Como: Criar modelos de Item

Referência

ProjectType Element (modelos de Visual Studio)

ProjectSubType Element (modelos de Visual Studio)

Referência de esquema de modelo do Studio Visual

Outros recursos

Modelos Visual Studio