Partage via


NamespaceCollection.Add(NamespaceInfo) Méthode

Définition

Ajoute un objet NamespaceInfo à la 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)

Paramètres

namespaceInformation
NamespaceInfo

Objet NamespaceInfo à ajouter à la collection.

Exceptions

L'objet NamespaceInfo à ajouter existe déjà dans la collection ou la collection est en lecture seule.

Exemples

L'exemple de code suivant montre comment utiliser la méthode Add. Cet exemple de code fait partie d’un exemple plus grand fourni pour la PagesSection classe.

// 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"))

Remarques

La collection ne doit pas déjà contenir d’objet NamespaceInfo avec la même Namespace valeur de propriété.

S’applique à

Voir aussi