Idioma

ProfilePropertySettingsCollection.Add(ProfilePropertySettings) Método

Definição

Adiciona um ProfilePropertySettings objeto à coleção.

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)

Parâmetros

propertySettings
ProfilePropertySettings

Um ProfilePropertySettings objeto a ser adicionado à coleção.

Exceções

O ProfilePropertySettings objeto a ser adicionado já existe na coleção ou a coleção é somente leitura.

Exemplos

O exemplo de código a seguir mostra como usar o Add método. Este exemplo de código faz parte de um exemplo maior fornecido para a 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)

Comentários

A coleção ainda não deve conter um ProfilePropertySettings objeto com o mesmo nome.

Aplica-se a

Confira também