Udostępnij za pośrednictwem


Element SnippetTypes (urywki kodu IntelliSense)

Poszczególnych grup SnippetType elementy.

<SnippetTypes>
    <SnippetType>... </SnippetType>
    <SnippetType>... </SnippetType>
<SnippetTypes>

Atrybuty i elementy

W poniższych sekcjach opisano atrybuty i elementy podrzędne elementy nadrzędne.

Atrybuty

Brak.

Elementy podrzędne

Element

Opis

SnippetType

Opcjonalnego elementu.

Określa, jak Visual Studio do kodu powoduje wstawienie wstawki kodu programu.Może istnieć zero lub więcej SnippetType elementów w SnippetTypes element.

Elementy nadrzędne

Element

Opis

Nagłówek

Określa ogólne informacje na temat wstawki kodu programu.

Uwagi

Jeśli SnippetTypes element nie jest obecny, wstawki kodu programu można wstawiać w dowolnym miejscu w kodzie.

Przykład

Wartość SnippetType element w poniższym przykładzie jest Expansion.Wskazuje, że Visual Studio można wstawić urywek kodu w bieżącym położeniu kursora.

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

Zobacz też

Koncepcje

Odwołanie schematu wstawek kodu