ConfigurationLockCollection.SetFromList(String) メソッド

定義

指定されたリストに基づいて、構成オブジェクトのセットをロックします。

C#
public void SetFromList (string attributeList);

パラメーター

attributeList
String

コンマ区切りの文字列。

例外

attributeList パラメーター内の項目がロックできる有効な構成属性ではない場合に発生します。

次のコード例は、SetFromList メソッドの使用方法を示します。 このコード例は、ConfigurationLockCollection クラスのために提供されている大規模な例の一部です。

C#
// 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);

適用対象

製品 バージョン
.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, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9