次の方法で共有


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

更新 : 2007 年 11 月

IntelliSense コード スニペットでインポートする必要のある名前空間を指定します。

<Import>
    <Namespace>... </Namespace>
</Import>

属性と要素

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

属性

なし。

子要素

要素

説明

Namespace

必須の要素

コード スニペットで使用される名前空間を指定します。Import 要素で使用できる Namespace 要素は 1 つだけです。

親要素

要素

説明

Imports

Import 要素のグループ化要素です。

解説

Imports 要素は、Visual Basic プロジェクトでのみサポートされます。

使用例

名前空間 System.Data をインポートするコード スニペットの例を次に示します。

<CodeSnippets xmlns="https://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <!-- Insert Header information here. -->
        </Header>
        <Snippet>
            <Imports>
                <Import>
                    <Namespace>System.Data</Namespace>
                </Import>
            </Imports>
            <Declarations>
                <!-- Insert literal and object declarations here. -->
            </Declarations>
            <Code Language="VB">
                <!-- Insert code here. -->
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

参照

概念

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