Share via


ProfilePropertySettingsCollection.Add(ProfilePropertySettings) Metodo

Definizione

Aggiunge un oggetto ProfilePropertySettings alla raccolta.

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)

Parametri

propertySettings
ProfilePropertySettings

Oggetto ProfilePropertySettings da aggiungere alla raccolta.

Eccezioni

L'oggetto ProfilePropertySettings da aggiungere è già presente nell'insieme oppure l'insieme è di sola lettura.

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare il metodo Add. Questo esempio di codice fa parte di un esempio più grande fornito per 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)

Commenti

L'insieme non deve già contenere un ProfilePropertySettings oggetto con lo stesso nome.

Si applica a

Vedi anche