ProfilePropertySettingsCollection.Add(ProfilePropertySettings) Metoda

Definicja

ProfilePropertySettings Dodaje obiekt do kolekcji.

C#
public void Add (System.Web.Configuration.ProfilePropertySettings propertySettings);

Parametry

propertySettings
ProfilePropertySettings

ProfilePropertySettings Obiekt do dodania do kolekcji.

Wyjątki

ProfilePropertySettings Obiekt do dodania już istnieje w kolekcji lub kolekcja jest tylko do odczytu.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać Add metody . Ten przykład kodu jest częścią większego przykładu podanego ProfileSection dla klasy.

C#
// Add a new PropertySettings to the group.
ProfilePropertySettings newProp = new ProfilePropertySettings("AvatarImage");
newProp.Type = "System.String, System.dll";
newPropGroup.PropertySettings.Add(newProp);

Uwagi

Kolekcja nie może już zawierać ProfilePropertySettings obiektu o tej samej nazwie.

Dotyczy

Produkt Wersje
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8

Zobacz też