System.CodeDom.CodeNamespace.Imports Property

Gets the collection of namespace import directives used by the namespace.

Syntax

public CodeNamespaceImportCollection Imports { get; }

Value

System.CodeDom.CodeNamespaceImportCollection object, which is a collection of imports applicable to the namespace.

Remarks

C# Example

/*	Creates namespace like thus when c# code is generated.
/*	namespace Mono.CodeDomDemo {
/*		using System.Data;
/*	}
...
CodeNamespace demoNs= new CodeNamespace("Mono.CodeDomDemo");
demoNs.Imports.Add(new CodeNamespaceImport("System.Data"));
...

Requirements

Namespace: System.CodeDom
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0