ProfileGroupSettingsCollection.Add(ProfileGroupSettings) 메서드

정의

컬렉션에 ProfileGroupSettings 개체를 추가합니다.

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)

매개 변수

group
ProfileGroupSettings

ProfileGroupSettings 컬렉션에 추가할 개체입니다.

예외

추가할 개체가 ProfileGroupSettings 컬렉션에 이미 있거나 컬렉션이 읽기 전용입니다.

예제

다음 코드 예제에서는 메서드를 사용 하는 방법을 보여 있습니다 Add . 이 코드 예제는 클래스에 제공된 더 큰 예제의 ProfileSection 일부입니다.

// 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()

설명

컬렉션에 이름이 같은 개체가 ProfileGroupSettings 아직 포함되어 있지 않아야 합니다.

적용 대상

추가 정보