System.Collections.SortedList.KeyList.IndexOf C# (CSharp) 메소드

IndexOf() 공개 메소드

public IndexOf ( Object key ) : int
key Object
리턴 int
            public virtual int IndexOf(Object key)
            {
                if (key == null)
                    throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
                Contract.EndContractBlock();

                int i = Array.BinarySearch(_sortedList._keys, 0,
                                           _sortedList.Count, key, _sortedList._comparer);
                if (i >= 0) return i;
                return -1;
            }