Click or drag to resize
OrderedDictionaryTKey, TValueRangeFrom Method
Returns a collection that can be used for enumerating some of the keys and values in the collection. Only keys that are greater than (and optionally, equal to) from are included. The keys are enumerated in sorted order. Keys equal to from can be included or excluded depending on the fromInclusive parameter.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public OrderedDictionaryTKey, TValueView RangeFrom(
	TKey from,
	bool fromInclusive
)

Parameters

from
Type: TKey
The lower bound of the range.
fromInclusive
Type: SystemBoolean
If true, the lower bound is inclusive--keys equal to the lower bound will be included in the range. If false, the lower bound is exclusive--keys equal to the lower 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, true)) {
   // process pair
}

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

See Also