Share via


Header Element (IntelliSense Code Snippets)

Specifies general information about the IntelliSense Code Snippet.

<CodeSnippets>
  <CodeSnippet>
    <Header>

<Header>
    <Title>... </Title>
    <Author>... </Author>
    <Description>... </Description>
    <HelpUrl>... </HelpUrl>
    <SnippetTypes>... </SnippetTypes>
    <Keywords>... </Keywords>
    <Shortcut>... </Shortcut>
</Header>

Attributes and Elements

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

Attributes

None.

Child Elements

Element

Description

Author

Optional element.

The name of the person or company that authored the code snippet. There may be zero or one Author elements in a Header element.

Description

Optional element.

A description of the code snippet. There may be zero or one Description elements in a Header element.

HelpURL

Optional element.

A URL that contains more information about the code snippet. There may be zero or one HelpURL elements in a Header element.

Keywords

Optional element.

Groups Keyword elements. There may be zero or one Keywords elements in a Header element.

Shortcut

Optional element.

Specifies the shortcut text that can be used to insert the snippet. There may be zero or one Shortcut elements in a Header element.

SnippetTypes

Optional element.

Groups SnippetType elements. There may be zero or one SnippetTypes elements in a Header element. If there are no SnippetTypes elements, the code snippet is always valid.

Title

Required element.

The friendly name of the code snippet. There must be exactly one Title element in a Header element.

Parent Elements

Element

Description

CodeSnippet

Parent element for all code snippet data.

Example

The following code shows how to set the values of the child elements of a Header element.

<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>

See Also

Concepts

Code Snippets Schema Reference