WizardData 項目 (Visual Studio 範本)

指定自訂 XML

\<VSTemplate>
\<WizardData>

語法

<WizardData>
    <!-- XML to pass to the custom wizard extension -->
    ...
</WizardData>

屬性和項目

下列章節將說明屬性、子項目和父項目。

屬性

無。

子元素

無。

父項目

元素 描述
VSTemplate 必要項目。

包含專案範本、專案範本或入門套件的所有元數據。

文字值

可選擇使用文字值。

此文字會指定要傳遞至WizardExtension元素中所指定之自定義精靈延伸模組的自定義 XML。

備註

您可以在這個項目中指定任何 XML。 XML 會當做參數傳遞至自定義精靈延伸模組,讓延伸模組使用這個項目的內容。 此數據不會進行驗證。

WizardData 元素的內容會以 方法中IWizard.RunStarted參數的字串字典內的參數傳遞,並保持不變。 字典索引鍵的名稱為 $wizarddata$

範例

下列範例說明 C# Windows 應用程式之標準專案範本的元數據。

<VSTemplate Version="3.0.0" Type="Item"
    xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
    <TemplateData>
        <Name>MyTemplate</Name>
        <Description>Template using IWizard extension</Description>
        <Icon>TemplateIcon.ico</Icon>
        <ProjectType>CSharp</ProjectType>
    </TemplateData>
    <TemplateContent>
        <Project File="MyTemplate.csproj">
            <ProjectItem>Form1.cs<ProjectItem>
            <ProjectItem>Form1.Designer.cs</ProjectItem>
            <ProjectItem>Program.cs</ProjectItem>
            <ProjectItem>Properties\AssemblyInfo.cs</ProjectItem>
            <ProjectItem>Properties\Resources.resx</ProjectItem>
            <ProjectItem>Properties\Resources.Designer.cs</ProjectItem>
            <ProjectItem>Properties\Settings.settings</ProjectItem>
            <ProjectItem>Properties\Settings.Designer.cs</ProjectItem>
        </Project>
    </TemplateContent>
    <WizardExtension>
        <Assembly>MyWizard, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, Custom=null</Assembly>
        <FullClassName>MyWizard.CustomWizard</FullClassName>
    </WizardExtension>
    <WizardData>
        <!-- XML to pass to the custom wizard extension -->
    </WizardData>
</VSTemplate>

另請參閱