Click or drag to resize
OrderedDictionaryTKey, TValueRangeTo Method
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: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public OrderedDictionaryTKey, TValueView RangeTo(
	TKey to,
	bool toInclusive
)

Parameters

to
Type: TKey
The upper bound of the range.
toInclusive
Type: SystemBoolean
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

Type: OrderedDictionaryTKey, TValueView
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.

See Also