CommaDelimitedStringCollection.IsReadOnly 属性
定义
获取一个值,该值指示集合对象是否为只读。Gets a value indicating whether the collection object is read-only.
public:
property bool IsReadOnly { bool get(); };
public bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public ReadOnly Property IsReadOnly As Boolean
属性值
如果 CommaDelimitedStringCollection 中指定的字符串元素是只读的,则为 true
;否则为 false
。true
if the specified string element in the CommaDelimitedStringCollection is read-only; otherwise, false
.
示例
下面的代码示例演示如何使用 IsReadOnly 属性。The following code example demonstrates how to use the IsReadOnly property. 此代码示例是为类概述提供的更大示例的一部分 CommaDelimitedStringCollection 。This code example is part of a larger example provided for the CommaDelimitedStringCollection class overview.
// Call IsReadyOnly.
Console.WriteLine("IsReadOnly: {0}",
myStrCollection.IsReadOnly);
' Call IsReadyOnly.
Console.WriteLine("IsReadOnly: {0}", _
myStrCollection.IsReadOnly)
注解
true
如果集合被标记为只读,则此属性返回。This property returns true
if the collection is marked as read-only. 这适用于在运行时保护元素,而不是设计时。This is useful for protecting the element at run time, as opposed to design time. 有关详细信息,请参见 IsReadOnly 类的方法 System.Configuration.ConfigurationElement 。For more information, see the IsReadOnly method on the System.Configuration.ConfigurationElement class.