Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Reference
 Imports Element (IntelliSense Code ...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio
Imports Element (IntelliSense Code Snippets)

Groups individual Import elements.

<Imports>
    <Import>... </Import>
<Imports>

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

Attributes

None.

Child Elements

Element

Description

Import

Optional element.

Contains the imported namespaces for the code snippet. There may be zero or more Import elements in an Imports element.

Parent Elements

Element

Description

Snippet

Contains the references, imports, declarations, and code for the code snippet.

The Imports element is only supported for Visual Basic projects.

The following example shows a code snippet that requires the namespaces System.Data and System.Xml to be imported.

<CodeSnippets xmlns="http://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>
                <Import>
                    <Namespace>System.Xml</Namespace>
                </Import>
            </Imports>
            <Declarations>
                <!-- Insert literal and object declarations here. -->
            </Declarations>
            <Code Language="VB">
                <!-- Insert code here. -->
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker