/// <summary> /// Get sequence from the item key value to end or start of the collection in the key order /// </summary> /// <param name="fromRangeKey"> /// Item key from which to start; inclusive if <paramref name="backwards"/> is <see langword="false"/> /// and exclusive otherwise /// </param> /// <param name="backwards"> /// Direction of the sequence: ascending if <see langword="false"/> and descending otherwise /// </param> /// <returns> /// <see cref="IDirectedEnumerable<V>"/> /// </returns> /// <remarks> /// Note that when going forward the item with range covering <paramref name="fromRangeKey"/> but starting before /// it will not be returned. /// </remarks> public IDirectedEnumerable <V> Select(K fromRangeKey, bool backwards) { C5.IDirectedEnumerable <C5.KeyValuePair <K, V> > seq; if (backwards) { seq = _dictionary.RangeTo(fromRangeKey).Backwards(); } else { seq = _dictionary.RangeFrom(fromRangeKey); } return(new C5DirectedEnumerable <V>(new DictionaryEnumerableValueAdapter <K, V>(seq))); }