CodeNamespaceImportCollection Class
Represents a collection of CodeNamespaceImport objects.
Assembly: System (in System.dll)
| Name | Description | |
|---|---|---|
![]() | CodeNamespaceImportCollection() | Initializes a new instance of the CodeNamespaceImportCollection class. |
| Name | Description | |
|---|---|---|
![]() | Count | Gets the number of namespaces in the collection. |
![]() | Item[Int32] | Gets or sets the CodeNamespaceImport object at the specified index in the collection. |
| Name | Description | |
|---|---|---|
![]() | Add(CodeNamespaceImport^) | Adds a CodeNamespaceImport object to the collection. |
![]() | AddRange(array<CodeNamespaceImport^>^) | Adds a set of CodeNamespaceImport objects to the collection. |
![]() | Clear() | Clears the collection of members. |
![]() | 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.) |
![]() | GetEnumerator() | Gets an enumerator that enumerates the collection members. |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ICollection::CopyTo(Array^, Int32) | This API supports the product infrastructure and is not intended to be used directly from your code. Copies the elements of the ICollection to an Array, starting at a particular Array index. |
![]() ![]() | IEnumerable::GetEnumerator() | This API supports the product infrastructure and is not intended to be used directly from your code. Returns an enumerator that can iterate through a collection. |
![]() ![]() | IList::Add(Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Adds an object to the IList. |
![]() ![]() | IList::Clear() | This API supports the product infrastructure and is not intended to be used directly from your code. Removes all items from the IList. |
![]() ![]() | IList::Contains(Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Determines whether the IList contains a specific value. |
![]() ![]() | IList::IndexOf(Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Determines the index of a specific item in the IList. |
![]() ![]() | IList::Insert(Int32, Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Inserts an item in the IList at the specified position. |
![]() ![]() | IList::Remove(Object^) | This API supports the product infrastructure and is not intended to be used directly from your code. Removes the first occurrence of a specific object from the IList. |
![]() ![]() | IList::RemoveAt(Int32) | This API supports the product infrastructure and is not intended to be used directly from your code. Removes the element at the specified index of the IList. |
![]() ![]() | ICollection::Count | This API supports the product infrastructure and is not intended to be used directly from your code. Gets the number of elements contained in the ICollection. |
![]() ![]() | ICollection::IsSynchronized | This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether access to the ICollection is synchronized (thread safe). |
![]() ![]() | ICollection::SyncRoot | Gets an object that can be used to synchronize access to the ICollection. |
![]() ![]() | IList::IsFixedSize | This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether the IList has a fixed size. |
![]() ![]() | IList::IsReadOnly | This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether the IList is read-only. |
![]() ![]() | IList::Item[Int32] | This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the element at the specified index. |
| Name | Description | |
|---|---|---|
![]() | AsParallel() | Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.) |
![]() | AsQueryable() | Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.) |
![]() | Cast<TResult>() | Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.) |
![]() | OfType<TResult>() | Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.) |
The CodeNamespaceImportCollection class provides a simple collection object that can be used to store a set of CodeNamespaceImport objects.
The following example demonstrates some of the members of the CodeNamespaceImportCollection class. The example initializes a new instance of the class, adds CodeNamespaceImport objects to it, and gets the total number of objects in the collection.
// Creates an empty CodeNamespaceImportCollection. CodeNamespaceImportCollection^ collection = gcnew CodeNamespaceImportCollection; // Adds a CodeNamespaceImport to the collection. collection->Add( gcnew CodeNamespaceImport( "System" ) ); // Adds an array of CodeNamespaceImport objects to the collection. array<CodeNamespaceImport^>^ Imports = { gcnew CodeNamespaceImport( "System" ), gcnew CodeNamespaceImport( "System.Drawing" )}; collection->AddRange( Imports ); // Retrieves the count of the items in the collection. int collectionCount = collection->Count;
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.





