ProfilePropertySettingsCollection.Add(ProfilePropertySettings) Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
ProfilePropertySettings Přidá objekt do kolekce.
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)
Parametry
- propertySettings
- ProfilePropertySettings
Objekt ProfilePropertySettings , který chcete přidat do kolekce.
Výjimky
Objekt ProfilePropertySettings , který chcete přidat, již v kolekci existuje nebo kolekce je jen pro čtení.
Příklady
Následující příklad kódu ukazuje, jak použít metodu Add . Tento příklad kódu je součástí většího příkladu uvedeného pro třídu ProfileSection.
// 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)
Poznámky
Kolekce již nesmí obsahovat ProfilePropertySettings objekt se stejným názvem.