更新:2007 年 11 月
对各个 SnippetType 元素进行分组。
<SnippetTypes>
    <SnippetType>... </SnippetType>
    <SnippetType>... </SnippetType>
<SnippetTypes>
属性和元素
以下几节描述了属性、子元素和父元素。
属性
无。
子元素
| 元素 | 说明 | 
|---|---|
| 可选的元素。 指定 Visual Studio 2005 如何将代码段插入到代码中。SnippetTypes 元素中可能有零个或多个 SnippetType 元素。 | 
父元素
| 元素 | 说明 | 
|---|---|
| 指定有关代码段的常规信息。 | 
备注
如果 SnippetTypes 元素不存在,则代码段可以插入到代码中的任何位置。
示例
在下面的示例中,SnippetType 元素的值为 Expansion。该值指示 Visual Studio 2005 可将代码段插入到光标当前所在的位置。
<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>