![Collapse image](collapse_all.gif)
![Expand Image](expand_all.gif)
![CollapseAll image](collall.gif)
![ExpandAll image](expall.gif)
![DropDown image](drpdown.gif)
![DropDownHover image](drpdown_orange.gif)
![Copy image](copycode.gif)
![CopyHover image](copycodeHighlight.gif)
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Returns a collection that can be used for enumerating some of the keys and values in the collection.
Only items that are less than (and optionally, equal to) to are included.
The items are enumerated in sorted order. Items equal to to can be included
or excluded depending on the toInclusive parameter.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
public OrderedDictionary<TKey, TValue>.OrderedDictionary<(Of <TKey, TValue>)>..::View RangeTo( TKey to, bool toInclusive ) |
Visual Basic (Declaration) |
---|
Public Function RangeTo ( _ to As TKey, _ toInclusive As Boolean _ ) As OrderedDictionary<(Of <TKey, TValue>)>..::View |
Visual C++ |
---|
public: OrderedDictionary<(Of <TKey, TValue>)>..::View^ RangeTo ( TKey to, bool toInclusive ) |
Parameters
- to
- TKey
The upper bound of the range.
- toInclusive
- Boolean
If true, the upper bound is inclusive--keys equal to the upper bound will be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not be included in the range.
Return Value
An OrderedDictionary.View of key-value pairs in the given range.
Remarks
The sorted order of the keys is determined by the comparison instance or delegate used to create the dictionary.
Typically, this property is used in conjunction with a foreach statement. For example:
![]() | |
---|---|
foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) { // process pair } |
Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.