Editar

Compartilhar via


NamespaceCollection.Add(NamespaceInfo) Method

Definition

Adds a NamespaceInfo object to the collection.

public:
 void Add(System::Web::Configuration::NamespaceInfo ^ namespaceInformation);
public void Add (System.Web.Configuration.NamespaceInfo namespaceInformation);
member this.Add : System.Web.Configuration.NamespaceInfo -> unit
Public Sub Add (namespaceInformation As NamespaceInfo)

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.

// Add a NamespaceInfo object using a constructor.
pagesSection.Namespaces.Add(
    new System.Web.Configuration.NamespaceInfo(
    "System.Collections.Specialized"));
' 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

See also