/// <summary> /// Gets the key for item. /// </summary> /// <param name="item">The item.</param> /// <returns>The key for the specified association.</returns> protected TKey GetKeyForItem(Association <TKey, TValue> item) { return(item.Key); }
void IList <Association <TKey, TValue> > .Insert(int index, Association <TKey, TValue> item) { throw new NotSupportedException(); }
/// <inheritdoc /> /// <example> /// <code source="..\..\Source\Examples\ExampleLibraryCSharp\DataStructures\General\SortedListExamples.cs" region="IndexOf" lang="cs" title="The following example shows how to use the IndexOf method."/> /// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\General\SortedListExamples.vb" region="IndexOf" lang="vbnet" title="The following example shows how to use the IndexOf method."/> /// </example> public int IndexOf(Association <TKey, TValue> item) { return(data.BinarySearch(item, comparerToUse)); }
/// <inheritdoc /> /// <example> /// <code source="..\..\Source\Examples\ExampleLibraryCSharp\DataStructures\General\SortedListExamples.cs" region="Contains" lang="cs" title="The following example shows how to use the Contains method."/> /// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\General\SortedListExamples.vb" region="Contains" lang="vbnet" title="The following example shows how to use the Contains method."/> /// </example> public bool Contains(Association <TKey, TValue> item) { return(data.Contains(item)); }
/// <inheritdoc /> public bool Remove(Association <TKey, TValue> item) { return(data.Remove(item)); }
/// <inheritdoc /> /// <example> /// <code source="..\..\Source\Examples\ExampleLibraryCSharp\DataStructures\General\SortedListExamples.cs" region="Add" lang="cs" title="The following example shows how to use the Add method."/> /// <code source="..\..\Source\Examples\ExampleLibraryVB\DataStructures\General\SortedListExamples.vb" region="Add" lang="vbnet" title="The following example shows how to use the Add method."/> /// </example> public void Add(Association <TKey, TValue> item) { AddSetItem(item); }