PropertyInformationCollection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
包含对象的集合 PropertyInformation 。 此类不能被继承。
public ref class PropertyInformationCollection sealed : System::Collections::Specialized::NameObjectCollectionBase
public sealed class PropertyInformationCollection : System.Collections.Specialized.NameObjectCollectionBase
[System.Serializable]
public sealed class PropertyInformationCollection : System.Collections.Specialized.NameObjectCollectionBase
type PropertyInformationCollection = class
inherit NameObjectCollectionBase
[<System.Serializable>]
type PropertyInformationCollection = class
inherit NameObjectCollectionBase
Public NotInheritable Class PropertyInformationCollection
Inherits NameObjectCollectionBase
- 继承
- 属性
示例
下面的代码示例演示如何使用该 PropertyInformationCollection 类。
// Create EllementInformation object.
ElementInformation elementInfo =
configSection.ElementInformation;
// Create a PropertyInformationCollection object.
PropertyInformationCollection propertyInfoCollection =
elementInfo.Properties;
// Create a PropertyInformation object.
PropertyInformation myPropertyInfo =
propertyInfoCollection["enabled"];
// Display the property value.
Console.WriteLine
("anonymousIdentification Section - Enabled: {0}",
myPropertyInfo.Value);
' Create EllementInformation object.
Dim elementInfo As ElementInformation = _
configSection.ElementInformation()
' Create a PropertyInformationCollection object.
Dim propertyInfoCollection As PropertyInformationCollection = _
elementInfo.Properties()
' Create a PropertyInformation object.
Dim myPropertyInfo As PropertyInformation = _
propertyInfoCollection("enabled")
' Display the property value.
Console.WriteLine _
("anonymousIdentification Section - Enabled: {0}", _
myPropertyInfo.Value)
注解
该 PropertyInformationCollection 对象包含对象的集合 PropertyInformation 。 对象 PropertyInformation 包含配置中单个属性的详细信息。 该 PropertyInformationCollection 对象派生自关联的 NameObjectCollectionBase 对象。
属性
| 名称 | 说明 |
|---|---|
| Count |
获取实例中包含的 NameObjectCollectionBase 键/值对数。 (继承自 NameObjectCollectionBase) |
| IsReadOnly |
获取或设置一个值,该值指示实例是否 NameObjectCollectionBase 为只读。 (继承自 NameObjectCollectionBase) |
| Item[String] |
PropertyInformation根据指定的属性名称获取集合中的对象。 |
| Keys |
获取包含 NameObjectCollectionBase.KeysCollection 实例中的所有键的 NameObjectCollectionBase 实例。 (继承自 NameObjectCollectionBase) |
方法
显式接口实现
| 名称 | 说明 |
|---|---|
| ICollection.CopyTo(Array, Int32) |
将整个 NameObjectCollectionBase 复制到兼容的一维 Array,从目标数组的指定索引处开始。 (继承自 NameObjectCollectionBase) |
| ICollection.IsSynchronized |
获取一个值,该值指示是否同步对 NameObjectCollectionBase 对象的访问(线程安全)。 (继承自 NameObjectCollectionBase) |
| ICollection.SyncRoot |
获取一个对象,该对象可用于同步对 NameObjectCollectionBase 对象的访问。 (继承自 NameObjectCollectionBase) |
扩展方法
| 名称 | 说明 |
|---|---|
| AsParallel(IEnumerable) |
启用查询的并行化。 |
| AsQueryable(IEnumerable) |
将 IEnumerable 转换为 IQueryable。 |
| Cast<TResult>(IEnumerable) |
将 IEnumerable 的元素强制转换为指定类型。 |
| OfType<TResult>(IEnumerable) |
根据指定类型筛选 IEnumerable 的元素。 |