ProfileGroupSettingsCollection.Add(ProfileGroupSettings) Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Fügt der Auflistung ein ProfileGroupSettings Objekt hinzu.
public:
void Add(System::Web::Configuration::ProfileGroupSettings ^ group);
public void Add(System.Web.Configuration.ProfileGroupSettings group);
member this.Add : System.Web.Configuration.ProfileGroupSettings -> unit
Public Sub Add (group As ProfileGroupSettings)
Parameter
- group
- ProfileGroupSettings
Ein ProfileGroupSettings Objekt, das der Auflistung hinzugefügt werden soll.
Ausnahmen
Das ProfileGroupSettings hinzuzufügende Objekt ist bereits in der Auflistung vorhanden, oder die Auflistung ist schreibgeschützt.
Beispiele
Das folgende Codebeispiel zeigt, wie die Add Methode verwendet wird. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die ProfileSection Klasse bereitgestellt wird.
// Add a new group.
ProfileGroupSettings newPropGroup = new ProfileGroupSettings("Forum");
profileSection.PropertySettings.GroupSettings.Add(newPropGroup);
// Add a new PropertySettings to the group.
ProfilePropertySettings newProp = new ProfilePropertySettings("AvatarImage");
newProp.Type = "System.String, System.dll";
newPropGroup.PropertySettings.Add(newProp);
// Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage");
newPropGroup.PropertySettings.RemoveAt(0);
// Clear all PropertySettings from the group.
newPropGroup.PropertySettings.Clear();
' Add a new group.
Dim newPropGroup As ProfileGroupSettings = new ProfileGroupSettings("Forum")
profileSection.PropertySettings.GroupSettings.Add(newPropGroup)
' Add a new PropertySettings to the group.
Dim newProp As ProfilePropertySettings = new ProfilePropertySettings("AvatarImage")
newProp.Type = "System.String, System.dll"
newPropGroup.PropertySettings.Add(newProp)
' Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage")
newPropGroup.PropertySettings.RemoveAt(0)
' Clear all PropertySettings from the group.
newPropGroup.PropertySettings.Clear()
Hinweise
Die Auflistung darf noch kein Objekt mit demselben Namen enthalten ProfileGroupSettings .