ManagementNamedValueCollection 类

定义

表示适合用作 WMI 操作上下文信息的命名值的集合。Represents a collection of named values suitable for use as context information to WMI operations. 名称不区分大小写。The names are case-insensitive.

public ref class ManagementNamedValueCollection : System::Collections::Specialized::NameObjectCollectionBase
public class ManagementNamedValueCollection : System.Collections.Specialized.NameObjectCollectionBase
type ManagementNamedValueCollection = class
    inherit NameObjectCollectionBase
Public Class ManagementNamedValueCollection
Inherits NameObjectCollectionBase
继承
ManagementNamedValueCollection

构造函数

ManagementNamedValueCollection()

初始化 ManagementNamedValueCollection 类的空的新实例。Initializes a new instance of the ManagementNamedValueCollection class, which is empty. 这就是无参数构造函数。This is the parameterless constructor.

ManagementNamedValueCollection(SerializationInfo, StreamingContext)

初始化 ManagementNamedValueCollection 类的新实例,该实例可序列化且使用指定的 SerializationInfoStreamingContextInitializes a new instance of the ManagementNamedValueCollection class that is serializable and uses the specified SerializationInfo and StreamingContext.

属性

Count

获取包含在 NameObjectCollectionBase 实例中的键/值对的数目。Gets the number of key/value pairs contained in the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
IsReadOnly

获取或设置一个值,通过该值指示 NameObjectCollectionBase 实例是否为只读的。Gets or sets a value indicating whether the NameObjectCollectionBase instance is read-only.

(继承自 NameObjectCollectionBase)
Item[String]

从该集合获取与指定的名称关联的值。Gets the value associated with the specified name from this collection. 在 C# 中,此属性是 ManagementNamedValueCollection 类的索引器。In C#, this property is the indexer for the ManagementNamedValueCollection class.

Keys

获取 NameObjectCollectionBase.KeysCollection 实例,该实例包含 NameObjectCollectionBase 实例中的所有键。Gets a NameObjectCollectionBase.KeysCollection instance that contains all the keys in the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)

方法

Add(String, Object)

向集合添加单名值。Adds a single-named value to the collection.

BaseAdd(String, Object)

将具有指定键和值的项添加到 NameObjectCollectionBase 实例中。Adds an entry with the specified key and value into the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseClear()

移除 NameObjectCollectionBase 实例中的所有项。Removes all entries from the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGet(Int32)

获取 NameObjectCollectionBase 实例的指定索引处的项值。Gets the value of the entry at the specified index of the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGet(String)

获取 NameObjectCollectionBase 实例中第一个具有指定键的项值。Gets the value of the first entry with the specified key from the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGetAllKeys()

返回 String 数组,该数组包含 NameObjectCollectionBase 实例中的所有键。Returns a String array that contains all the keys in the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGetAllValues()

返回 Object 数组,该数组包含 NameObjectCollectionBase 实例中的所有值。Returns an Object array that contains all the values in the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGetAllValues(Type)

返回指定类型的数组,该数组包含 NameObjectCollectionBase 实例中的所有值。Returns an array of the specified type that contains all the values in the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseGetKey(Int32)

获取 NameObjectCollectionBase 实例的指定索引处的项键。Gets the key of the entry at the specified index of the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseHasKeys()

获取一个值,通过该值指示 NameObjectCollectionBase 实例是否包含键不为 null 的项。Gets a value indicating whether the NameObjectCollectionBase instance contains entries whose keys are not null.

(继承自 NameObjectCollectionBase)
BaseRemove(String)

移除 NameObjectCollectionBase 实例中具有指定键的项。Removes the entries with the specified key from the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
BaseRemoveAt(Int32)

移除 NameObjectCollectionBase 实例的指定索引处的项。Removes the entry at the specified index of the NameObjectCollectionBase instance.

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

设置 NameObjectCollectionBase 实例的指定索引处的项值。Sets the value of the entry at the specified index of the NameObjectCollectionBase instance.

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

NameObjectCollectionBase 实例中第一个具有指定键的项设置值(如果有这样的项);否则将具有指定键和值的项添加到 NameObjectCollectionBase 实例中。Sets the value of the first entry with the specified key in the NameObjectCollectionBase instance, if found; otherwise, adds an entry with the specified key and value into the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
Clone()

创建集合的复本。Creates a clone of the collection. 会分别克隆各个值。Individual values are cloned. 如果某个值不支持克隆,则会引发 NotSupportedExceptionIf a value does not support cloning, then a NotSupportedException is thrown.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetEnumerator()

返回循环访问 NameObjectCollectionBase 的枚举器。Returns an enumerator that iterates through the NameObjectCollectionBase.

(继承自 NameObjectCollectionBase)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetObjectData(SerializationInfo, StreamingContext)

实现 ISerializable 接口,并返回序列化 NameObjectCollectionBase 实例所需的数据。Implements the ISerializable interface and returns the data needed to serialize the NameObjectCollectionBase instance.

(继承自 NameObjectCollectionBase)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnDeserialization(Object)

实现 ISerializable 接口,并在完成反序列化之后引发反序列化事件。Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.

(继承自 NameObjectCollectionBase)
Remove(String)

从集合中移除一个单名值。Removes a single-named value from the collection. 如果集合不包含使用指定名称的元素,则该集合保持不变,且不引发异常。If the collection does not contain an element with the specified name, the collection remains unchanged and no exception is thrown.

RemoveAll()

从集合中移除所有项。Removes all entries from the collection.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

显式接口实现

ICollection.CopyTo(Array, Int32)

从目标数组的指定索引处开始将整个 NameObjectCollectionBase 复制到兼容的一维 ArrayCopies the entire NameObjectCollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.

(继承自 NameObjectCollectionBase)
ICollection.IsSynchronized

获取一个值,该值指示对 NameObjectCollectionBase 对象的访问是否同步(线程安全)。Gets a value indicating whether access to the NameObjectCollectionBase object is synchronized (thread safe).

(继承自 NameObjectCollectionBase)
ICollection.SyncRoot

获取一个对象,该对象可用于同步对 NameObjectCollectionBase 对象的访问。Gets an object that can be used to synchronize access to the NameObjectCollectionBase object.

(继承自 NameObjectCollectionBase)

扩展方法

Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于