Visual Studio Element Template with Wizard

I am looking for a sample of how to create an element template using Wizard in Visual Studio 2010. My requirement is that when the user selects Add Item, I want to show a dialog in which the user enters some input parameters. Then, when you click OK on the form, we create the XML file that we want to add to the project.

thank

+3
source share
1 answer

I would recommend you get vsix in this link
http://blogs.msdn.com/b/visualstudio/archive/2010/03/04/creating-and-sharing-project-item-templates.aspx
and rename it as a zip file and open it to start. however, the xml in the template elements themselves is not that difficult. Looking at what I just generated using the tool for a classic asp file.


<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
  <TemplateData>
    <DefaultName>Classic ASP</DefaultName> 
    <Name>Classic ASP</Name>
    <Description>Adds script tag import ref</Description>
    <ProjectType>Web</ProjectType>
    <ProjectSubType>VisualBasic</ProjectSubType>
    <SortOrder>10</SortOrder>
    <Icon>__TemplateIcon.ico</Icon>
  </TemplateData>
  <TemplateContent>
    <References />
    <ProjectItem TargetFileName="$fileinputname$.asp" ReplaceParameters="true">ClassicASP.asp</ProjectItem>
  </TemplateContent>
</VSTemplate>

0
source

Source: https://habr.com/ru/post/1794230/


All Articles