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

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

实现

注解

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

的元素按与 ICollection 的键相同的顺序进行排序 SortedListThe 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.

适用于

另请参阅