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.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic OrderedDictionaryTKey, TValueView RangeFrom(
TKey from,
bool fromInclusive
)
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, TValueViewAn OrderedDictionary.View of key-value pairs in the given range.
RemarksThe 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)) {
}
Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.
See Also