Export (0) Print
Expand All

SnippetTypes Element (IntelliSense Code Snippets)

Groups individual SnippetType elements.

<CodeSnippets>
   <CodeSnippet>
     <Header>
       <SnippetTypes>
<SnippetTypes>
    <SnippetType>... </SnippetType>
    <SnippetType>... </SnippetType>
<SnippetTypes>

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

Element

Description

SnippetType

Optional element.

Specifies how Visual Studio inserts the code snippet into the code. There may be zero or more SnippetType elements in a SnippetTypes element.

Parent Elements

Element

Description

Header

Specifies general information about the code snippet.

If the SnippetTypes element is not present, the code snippet can be inserted anywhere in the code.

The value of the SnippetType element in the following example is Expansion. This indicates that Visual Studio can insert the code snippet at the current position of the cursor.

<CodeSnippets xmlns="http://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>
Show:
© 2014 Microsoft