语言

PropertyInformationCollection 类

定义

包含对象的集合 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
属性

示例

下面的代码示例演示如何使用该 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)

方法

名称 说明
BaseAdd(String, Object)

将具有指定键和值的条目添加到实例中 NameObjectCollectionBase

(继承自 NameObjectCollectionBase)
BaseClear()

NameObjectCollectionBase 实例中删除所有条目。

(继承自 NameObjectCollectionBase)
BaseGet(Int32)

获取实例的指定索引处的 NameObjectCollectionBase 项的值。

(继承自 NameObjectCollectionBase)
BaseGet(String)

获取具有实例中指定键 NameObjectCollectionBase 的第一个条目的值。

(继承自 NameObjectCollectionBase)
BaseGetAllKeys()

返回一个 String 数组,其中包含实例中的所有 NameObjectCollectionBase 键。

(继承自 NameObjectCollectionBase)
BaseGetAllValues()

返回一个 Object 数组,其中包含实例中的所有 NameObjectCollectionBase 值。

(继承自 NameObjectCollectionBase)
BaseGetAllValues(Type)

返回一个指定类型的数组,该数组包含实例中的所有 NameObjectCollectionBase 值。

(继承自 NameObjectCollectionBase)
BaseGetKey(Int32)

获取实例的指定索引处的项的 NameObjectCollectionBase 键。

(继承自 NameObjectCollectionBase)
BaseHasKeys()

获取一个值,该值指示实例是否 NameObjectCollectionBase 包含其键不是 null的条目。

(继承自 NameObjectCollectionBase)
BaseRemove(String)

从实例中删除具有指定键的 NameObjectCollectionBase 条目。

(继承自 NameObjectCollectionBase)
BaseRemoveAt(Int32)

删除实例的指定索引处的 NameObjectCollectionBase 条目。

(继承自 NameObjectCollectionBase)
BaseSet(Int32, Object)

设置实例的指定索引处的 NameObjectCollectionBase 条目的值。

(继承自 NameObjectCollectionBase)
BaseSet(String, Object)

如果找到,则设置实例中 NameObjectCollectionBase 具有指定键的第一个条目的值;否则,将具有指定键和值的条目添加到实例中 NameObjectCollectionBase

(继承自 NameObjectCollectionBase)
CopyTo(PropertyInformation[], Int32)

将整个 PropertyInformationCollection 集合复制到兼容的一维 Array,从目标数组的指定索引处开始。

Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetEnumerator()

获取一个 IEnumerator 对象,该对象用于循环访问此 PropertyInformationCollection 集合。

GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetObjectData(SerializationInfo, StreamingContext)
已过时.

使用 SerializationInfo 序列化 PropertyInformationCollection 实例所需的数据填充对象。

GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
OnDeserialization(Object)

实现接口, ISerializable 并在反序列化完成后引发反序列化事件。

(继承自 NameObjectCollectionBase)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

显式接口实现

名称 说明
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 的元素。

适用于

另请参阅