Represents a collection of CodeNamespaceImport objects.
For a list of all members of this type, see CodeNamespaceImportCollection Members.
System.Object
System.CodeDom.CodeNamespaceImportCollection
[Visual Basic] <Serializable> <ClassInterface(ClassInterfaceType.AutoDispatch)> <ComVisible(True)> Public Class CodeNamespaceImportCollection Implements IList, ICollection, IEnumerable [C#] [Serializable] [ClassInterface(ClassInterfaceType.AutoDispatch)] [ComVisible(true)] public class CodeNamespaceImportCollection : IList, ICollection, IEnumerable [C++] [Serializable] [ClassInterface(ClassInterfaceType::AutoDispatch)] [ComVisible(true)] public __gc class CodeNamespaceImportCollection : public IList, ICollection, IEnumerable [JScript] public Serializable ClassInterface(ClassInterfaceType.AutoDispatch) ComVisible(true) class CodeNamespaceImportCollection implements IList, ICollection, IEnumerable
Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.
The CodeNamespaceImportCollection class provides a simple collection object that can be used to store a set of CodeNamespaceImport objects.
[Visual Basic] ' Creates an empty CodeNamespaceImportCollection. Dim collection As New CodeNamespaceImportCollection() ' Adds a CodeNamespaceImport to the collection. collection.Add(New CodeNamespaceImport("System")) ' Adds an array of CodeNamespaceImport objects to the collection. Dim [Imports] As CodeNamespaceImport() = _ {New CodeNamespaceImport("System"), _ New CodeNamespaceImport("System.Drawing")} collection.AddRange([Imports]) ' Retrieves the count of the items in the collection. Dim collectionCount As Integer = collection.Count [C#] // Creates an empty CodeNamespaceImportCollection. CodeNamespaceImportCollection collection = new CodeNamespaceImportCollection(); // Adds a CodeNamespaceImport to the collection. collection.Add( new CodeNamespaceImport("System") ); // Adds an array of CodeNamespaceImport objects to the collection. CodeNamespaceImport[] Imports = { new CodeNamespaceImport("System"), new CodeNamespaceImport("System.Drawing") }; collection.AddRange( Imports ); // Retrieves the count of the items in the collection. int collectionCount = collection.Count;
[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button
in the upper-left corner of the page.
Namespace: System.CodeDom
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: System (in System.dll)
CodeNamespaceImportCollection Members | System.CodeDom Namespace | CodeNamespaceImport