INameObjectCollection Interface

Definition

定义可通过键或索引访问的关联字符串键和对象值的集合。Defines a collection of associated string keys and object values that can be accessed either with the key or with an index.

public interface class INameObjectCollection : System::Collections::ICollection
public interface INameObjectCollection : System.Collections.ICollection
type INameObjectCollection = interface
    interface ICollection
    interface IEnumerable
Public Interface INameObjectCollection
Implements ICollection
Implements

Methods

Add(String, Object)

将具有指定键和值的项添加到集合中。Adds an entry with the specified key and value into the collection.

Get(Int32)

检索实例中指定项的值。Retrieves the value of the specified entry from the instance.

Get(String)

从实例中检索具有指定键的第一个项的值。Retrieves the value of the first entry with the specified key from the instance.

Remove(String)

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

RemoveAt(Int32)

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

Set(Int32, Object)

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

Set(String, Object)

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

Applies to