Represents a namespace declaration.
Assembly: System (in System.dll)
Thetype exposes the following members.
|Comments||Gets the comments for the namespace.|
|Imports||Gets the collection of namespace import directives used by the namespace.|
|Name||Gets or sets the name of the namespace.|
|Types||Gets the collection of types that the namespace contains.|
|UserData||Gets the user-definable data for the current object. (Inherited from CodeObject.)|
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Serves as the default hash function. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
can be used to represent a namespace declaration.
The Name property specifies the name of the namespace. The Imports property contains the namespace import directives for the namespace. The Types property contains the type declarations for the namespace. The 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.
The following example code demonstrates use of a to declare a namespace.