共用方式為


Keywords 項目 (IntelliSense 程式碼片段)

群組個別的 Keyword 項目。

<Keywords>
    <Keyword>... </Keyword>
    <Keyword>... </Keyword>
<Keywords>

屬性和項目

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

屬性

無。

子項目

項目

描述

關鍵字

選擇性項目。

包含程式碼片段的個別關鍵字。 Keywords 項目中可能有零個或多個 Keyword 項目。

父項目

項目

描述

Header

包含有關該程式碼片段的一般資訊。

備註

程式碼片段關鍵字是由 Visual Studio 所使用,並且是線上內容提供者為搜尋或分類加入自訂關鍵字的標準方法。

範例

下列程式碼片段包含 File copying 與 Copying files 關鍵字。

<CodeSnippets xmlns="https://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Copy File</Title>
            <Author>Microsoft Corporation</Author>
            <Description>Copies a file and saves it as another file.</Description>
            <HelpUrl>www.microsoft.com</HelpUrl>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
            <Keywords>
                 <Keyword>File copying</Keyword>
                 <Keyword>Copying files</Keyword>
            </Keywords>
            <Shortcut>copyfile</Shortcut>
        </Header>
        <Snippet>
            <!-- Insert snippet information here -->
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

請參閱

概念

程式碼片段結構描述參考