Share via


ProfilePropertySettingsCollection.Add(ProfilePropertySettings) Méthode

Définition

Ajoute un objet ProfilePropertySettings à la collection.

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

Paramètres

propertySettings
ProfilePropertySettings

Objet ProfilePropertySettings à ajouter à la collection.

Exceptions

L'objet ProfilePropertySettings à 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 ProfileSection classe .

// Add a new PropertySettings to the group.
ProfilePropertySettings newProp = new ProfilePropertySettings("AvatarImage");
newProp.Type = "System.String, System.dll";
newPropGroup.PropertySettings.Add(newProp);
' Add a new PropertySettings to the group.
Dim newProp As ProfilePropertySettings = new ProfilePropertySettings("AvatarImage")
newProp.Type = "System.String, System.dll"
newPropGroup.PropertySettings.Add(newProp)

Remarques

La collection ne doit pas déjà contenir un ProfilePropertySettings objet portant le même nom.

S’applique à

Voir aussi