(Visual Studio 範本的 PromptForSaveOnCreation 元素)
指定在建立專案時,是否透過 [ 新增專案 ] 對話方塊,提示使用者輸入專案儲存位置。 如果這個元素設定為 true ,系統就會提示使用者輸入儲存位置。 若 false 為,則不會提示 (也就是) 建立暫存專案。
\<VSTemplate>
\<TemplateData>
\<PromptForSaveOnCreation>
Syntax
<PromptForSaveOnCreation> true/false </PromptForSaveOnCreation>
屬性和元素
下列章節說明屬性、子元素和父元素。
屬性
無。
子元素
無。
父元素
| 元素 | 描述 |
|---|---|
| TemplateData | 必要元素。 將範本分類,並定義該範本在 [新增專案] 或 [加入新項目] 對話方塊中顯示的方式。 |
文字值
需要文字值。
文字必須是 true 或 false ,表示在 true 建立新專案時,系統會提示使用者輸入儲存位置。
備註
是選擇性元素。 預設值是 false。
臨時專案是指您可以建立和修改的專案,而不會將該專案的內容儲存在磁片上。
範例
下列範例會將等於的值設定為 PromptForSaveOnCreation false ,以指定允許將專案建立為暫存專案。
<VSTemplate Type="Project" Version="3.0.0"
xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>My template</Name>
<Description>A basic template</Description>
<Icon>TemplateIcon.ico</Icon>
<ProjectType>CSharp</ProjectType>
<PromptForSaveOnCreation>false</PromptForSaveOnCreation>
</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>
</VSTemplate>