System.CodeDom.CodeNamespace Class

Represents a namespace declaration.

See Also: CodeNamespace Members


public class CodeNamespace : CodeObject


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.


Use fully qualified type references to avoid potential ambiguity.


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