SortedList.Keys 属性

定义

获取 SortedList 对象中的键。Gets the keys in a SortedList object.

public:
 virtual property System::Collections::ICollection ^ Keys { System::Collections::ICollection ^ get(); };
public virtual System.Collections.ICollection Keys { get; }
member this.Keys : System.Collections.ICollection
Public Overridable ReadOnly Property Keys As ICollection

属性值

包含 ICollection 对象中的键的 SortedList 对象。An ICollection object containing the keys in the SortedList object.

实现

注解

ICollection 对象是 SortedList 对象的键的只读视图。The ICollection object is a read-only view of the keys of the SortedList object. 对基础 SortedList 所做的修改会立即反映在 ICollection中。Modifications made to the underlying SortedList are immediately reflected in the ICollection.

ICollection 的元素按与 SortedList键相同的顺序进行排序。The elements of the ICollection are sorted in the same order as the keys of the SortedList.

此属性类似于 GetKeyList 方法,但返回 ICollection 对象而不是 IList 对象。This property is similar to the GetKeyList method, but returns an ICollection object instead of an IList object.

此方法是一个 O(1) 操作。This method is an O(1) operation.

适用于

另请参阅