Keyword 元素(IntelliSense 代码段)

为代码段指定自定义关键字。

<Keyword>
    Code Snippet Keyword
</Keyword>

特性和元素

以下几节描述了特性、子元素和父元素。

特性

无。

子元素

无。

父元素

元素

说明

关键字

对各个 Keyword 元素进行分组。

文本值

需要一个文本值。

代码段的关键字。

备注

代码段关键字由 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>

请参见

概念

代码段架构参考