ConfigurationLockCollection.SetFromList(String) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Sağlanan listeye göre bir dizi yapılandırma nesnesini kilitler.
public:
void SetFromList(System::String ^ attributeList);
public void SetFromList (string attributeList);
member this.SetFromList : string -> unit
Public Sub SetFromList (attributeList As String)
Parametreler
- attributeList
- String
Virgülle ayrılmış bir dize.
Özel durumlar
Parametredeki attributeList
bir öğe geçerli bir kilitlenebilir yapılandırma özniteliği olmadığında gerçekleşir.
Örnekler
Aşağıdaki kod örneğinde yönteminin nasıl kullanılacağı gösterilmektedir SetFromList . Bu kod örneği, sınıfı için ConfigurationLockCollection sağlanan daha büyük bir örneğin parçasıdır.
// 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)
Şunlara uygulanır
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin