次の方法で共有


SnippetTypes 要素 (IntelliSense コード スニペット)

更新 : 2007 年 11 月

複数の SnippetType 要素をグループ化します。

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

属性と要素

以降のセクションでは、属性、子要素、および親要素について説明します。

属性

なし。

子要素

要素

説明

SnippetType

省略可能な要素

Visual Studio 2005 がコード スニペットをコードに挿入するときの動作を指定します。SnippetTypes 要素に 0 個以上の SnippetType 要素があります。

親要素

要素

説明

Header

コード スニペットに関する全般的な情報を指定します。

解説

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>

参照

概念

コード スニペット スキーマ リファレンス