ProfilePropertySettingsCollection.Add(ProfilePropertySettings) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Agrega un ProfilePropertySettings objeto a la colección.
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
Objeto ProfilePropertySettings que se va a agregar a la colección.
Excepciones
El ProfilePropertySettings objeto que se va a agregar ya existe en la colección o la colección es de solo lectura.
Ejemplos
En el ejemplo de código siguiente se muestra cómo usar el Add método . Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la ProfileSection clase .
// 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)
Comentarios
La colección aún no debe contener un ProfilePropertySettings objeto con el mismo nombre.