ProfilePropertySettingsCollection.Add(ProfilePropertySettings) Metod

Definition

Lägger till ett ProfilePropertySettings objekt i samlingen.

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)

Parametrar

propertySettings
ProfilePropertySettings

Ett ProfilePropertySettings objekt som ska läggas till i samlingen.

Undantag

Objektet ProfilePropertySettings som ska läggas till finns redan i samlingen eller så är samlingen skrivskyddad.

Exempel

I följande kodexempel visas hur metoden Add används. Det här kodexemplet är en del av ett större exempel för ProfileSection klassen.

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

Kommentarer

Samlingen får inte redan innehålla ett ProfilePropertySettings objekt med samma namn.

Gäller för

Se även