ConfigurationLockCollection.SetFromList(String) 메서드

정의

제공된 목록에 따라 구성 개체 집합을 잠급 수 있습니다.

public:
 void SetFromList(System::String ^ attributeList);
public void SetFromList(string attributeList);
member this.SetFromList : string -> unit
Public Sub SetFromList (attributeList As String)

매개 변수

attributeList
String

쉼표로 구분된 문자열입니다.

예외

매개 변수의 항목이 attributeList 유효한 잠금 가능한 구성 특성이 아닌 경우 발생합니다.

예제

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

// Create an ArrayList to contain
// the property items of the configuration
// section.
ArrayList configPropertyAL = new ArrayList(lockedAttribList.Count);
foreach (PropertyInformation propertyItem in
  configSection.ElementInformation.Properties)
{
  configPropertyAL.Add(propertyItem.Name.ToString());
}
// Copy the elements of the ArrayList to a string array.
String[] myArr = (String[])configPropertyAL.ToArray(typeof(string));
// Create as a comma delimited list.
string propList = string.Join(",", myArr);
// Lock the items in the list.
lockedAttribList.SetFromList(propList);
' Create an ArrayList to contain
' the property items of the configuration
' section.
Dim configPropertyAL As ArrayList = _
 New ArrayList(lockedAttribList.Count)
For Each propertyItem As _
 PropertyInformation In _
 configSection.ElementInformation.Properties
  configPropertyAL.Add(propertyItem.Name.ToString())
Next
' Copy the elements of the ArrayList to a string array.
Dim myArr As [String]() = _
CType(configPropertyAL.ToArray(GetType(String)), [String]())
' Create as a comma delimited list.
Dim propList As String = String.Join(",", myArr)
' Lock the items in the list.
lockedAttribList.SetFromList(propList)

적용 대상