Op Englesch liesen Editéieren

Deelen iwwer


NamespaceCollection.Add(NamespaceInfo) Method

Definition

Adds a NamespaceInfo object to the collection.

C#
public void Add(System.Web.Configuration.NamespaceInfo namespaceInformation);

Parameters

namespaceInformation
NamespaceInfo

A NamespaceInfo object to add to the collection.

Exceptions

The NamespaceInfo object to add already exists in the collection or the collection is read-only.

Examples

The following code example shows how to use the Add method. This code example is part of a larger example provided for the PagesSection class.

C#
// Add a NamespaceInfo object using a constructor.
pagesSection.Namespaces.Add(
    new System.Web.Configuration.NamespaceInfo(
    "System.Collections.Specialized"));

Remarks

The collection must not already contain a NamespaceInfo object with the same Namespace property value.

Applies to

Produkt Versiounen
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also