System.CodeDom.CodeNamespace Class

Represents a namespace declaration.

See Also: CodeNamespace Members

Syntax

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class CodeNamespace : CodeObject

Remarks

System.CodeDom.CodeNamespace can be used to represent a namespace declaration.

The CodeNamespace.Name property specifies the name of the namespace. The CodeNamespace.Imports property contains the namespace import directives for the namespace. The CodeNamespace.Types property contains the type declarations for the namespace. The CodeNamespace.Comments property contains the comments that apply at the namespace level.

In some languages, a namespace can function as a container for type declarations; all types in the same namespace are accessible without using fully-qualified type references, if the there is no conflict between type names.

Note:

Use fully qualified type references to avoid potential ambiguity.

Requirements

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