NAnt SDK Documentation - v0.92

NamespaceImportCollection Class

Contains a collection of NamespaceImport items.

For a list of all members of this type, see NamespaceImportCollection Members.

System.Object
   NAnt.Core.Element
      NAnt.Core.DataTypeBase
         NAnt.DotNet.Types.DataTypeCollectionBase
            NAnt.DotNet.Types.NamespaceImportCollection

[Visual Basic]
<Serializable, _  Serializable, _  DefaultMember(MemberName:="Item"), _  ElementName(Name:="namespaceimports")>
Public Class NamespaceImportCollection
    Inherits DataTypeCollectionBase
    Implements IList
[C#]
[Serializable]
[Serializable]
[DefaultMember(MemberName="Item")]
[ElementName(Name="namespaceimports")]
public class NamespaceImportCollection : DataTypeCollectionBase, IList

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Example

Define a reference with name "system.imports".

    
<namespaceimports id="system.imports">
    <import namespace="System" />
    <import namespace="System.Data" />
</namespaceimports>
    
  

Use the predefined set of imports to compile a VB.NET assembly.

    
<vbc target="exe" output="HelloWorld.exe" rootnamespace="HelloWorld">
    <imports refid="system.imports" />
    <sources>
        <include name="**/*.vb" />
    </sources>
    <references>
        <include name="System.dll" />
        <include name="System.Data.dll" />
    </references>
</vbc>
    
  

Requirements

Namespace: NAnt.DotNet.Types

Assembly: NAnt.DotNetTasks (in NAnt.DotNetTasks.dll)

See Also

NamespaceImportCollection Members | NAnt.DotNet.Types Namespace