Core/CafeLib.Core.Collections/Dictionary/OrderedDictionary.cs
/// <summary>
/// Returns the zero-based index of the specified key in the <see cref="OrderedDictionary{TKey,TValue}">OrderedDictionary&lt;TKey,TValue&gt;</see>
/// </summary>
/// <param name="key">The key to locate in the <see cref="OrderedDictionary{TKey,TValue}">OrderedDictionary&lt;TKey,TValue&gt;</see></param>
/// <returns>The zero-based index of <paramref name="key"/>, if <paramref name="key"/> is found in the <see cref="OrderedDictionary{TKey,TValue}">OrderedDictionary&lt;TKey,TValue&gt;</see>; otherwise, -1</returns>
/// <remarks>This method performs a linear search; therefore it has a cost of O(n) at worst.</remarks>
Returns the zero-based index of the specified key in the OrderedDictionary
Returns the zero - based index of the specified key in the OrderedDictionary
private int IndexOfKey(TKey key)
        {
            if (null == key)
                throw new ArgumentNullException(nameof(key));
            for (int index = 0; index < List.Count; index++)
            {
                KeyValuePair<TKey, TValue> entry = List[index];
                TKey next = entry.Key;
                if (null != _comparer)
                {
                    if (_comparer.Equals(next, key))
                    {
                        return index;
                    }
                }
                else if (next.Equals(key))
                {
                    return index;
                }
            }
            return -1;
        }
private int IndexOfKey ( TKey key ) { if ( null == key ) throw new ArgumentNullException ( nameof ( key ) ) ; for ( int index = 0 ; index < List . Count ; index ++ ) { KeyValuePair < TKey , TValue > entry = List [ index ] ; TKey next = entry . Key ; if ( null != _comparer ) { if ( _comparer . Equals ( next , key ) ) { return index ; } } else if ( next . Equals ( key ) ) { return index ; } } return - 1 ; }
Returns the zero-based index of the specified key in the OrderedDictionary<TKey,TValue>
Returns the zero - based index of the specified key in the OrderedDictionary<TKey TValue >
The zero-based index of , if  is found in the OrderedDictionary
The zero - based index of if is found in the OrderedDictionary
key
TKey
The key to locate in the OrderedDictionary
The key to locate in the OrderedDictionary
remarks
This method performs a linear search; therefore it has a cost of O(n) at worst.
This method performs a linear search ; therefore it has a cost of O ( n ) at worst .