如何调用向导添加新的项目模板 [英] How call a wizard to add new Item Template

查看:19
本文介绍了如何调用向导添加新的项目模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过向导生成的项目模板.现在我想通过同一个向导添加一个新的项目模板.我如何在添加新项目模板时调用向导.

I have a project template that is generated through a wizard. Now i want to add a new item template through the same wizard. How can i invoke the wizard at the moment that i add the new item template.

示例:

[添加到项目模板]

[Wizard/Form]

[Wizard/Form]

[添加新的项目模板]

[显示向导模板]

[显示新物品/类别]

项目模板代码:

<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
  <TemplateData>
    <DefaultName>class1.cs</DefaultName>
    <Name>Myproject class1</Name>
    <Description>Myproject Class</Description>
    <ProjectType>CSharp</ProjectType>
    <SortOrder>10</SortOrder>
    <Icon>Myprojectclass1.png</Icon>
  </TemplateData>
  <TemplateContent>
    <References>
      <Reference>
        <Assembly>System</Assembly>
      </Reference>
      <Reference>
        <Assembly>System.Linq</Assembly>
      </Reference>
      <Reference>
        <Assembly>System.Threading.Tasks</Assembly>
      </Reference>
    </References>
    <ProjectItem SubType="Code" TargetFileName="$fileinputname$.cs" ReplaceParameters="true">class1.cs</ProjectItem>
    <CustomParameters>  
        <CustomParameter Name="$username$" Value="$safeitemrootname$"/> 
        <CustomParameter Name="$rootnamespace$" Value="$safeitemrootname$"/>
        <CustomParameter Name="$registeredorganization$" Value="$safeitemrootname$"/>
    </CustomParameters>  
  </TemplateContent>
    <WizardExtension>
    <Assembly>MyProjectWizard, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=f7a1fcb8d457e160</Assembly>
    <FullClassName>MyProjectWizard.WizardImplementation</FullClassName>
  </WizardExtension>
</VSTemplate>

推荐答案

我已经找到解决方法了,没有其他方法调用模板项而不是key.snk.

I have already found the solution, there is no other way to call the template item without being key.snk.

因为当我调用 itemtemplate 时,我必须实现我的 item,所以我选择了创建的项目,唯一的方法是通过 key.snk.

Because when I call an itemtemplate I have to implement my item I chose the project created and the only way to do that is by key.snk.

如果他们有不同的表单请回复这个问题,我想知道是否有更多的方式来调用Item模板.

If they have a different form please respond to this question, I want to know if there are more ways to call the Item template.

这篇关于如何调用向导添加新的项目模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆