// ----------------------------------------------------------------------------- // file="IBidirectionalDictionary" // Project: StgSharp // Copyright (c) Nitload. // SPDX-License-Identifier: MIT // ----------------------------------------------------------------------------- using System.Collections.Generic; namespace StgSharp.Collections { public interface IBidirectionalDictionary : IDictionary { TFirst this[ TSecond key ] { get; set; } ICollection FirstIndex { get; } ICollection SecondIndex { get; } IReadOnlyDictionary Forward { get; } IReadOnlyDictionary Reverse { get; } /// /// Determines whether the contains the /// specified key. /// /// /// The value to locate in the . /// /// /// true if the contains an element with /// the specified key; otherwise, false. /// bool Contains( TSecond key ); /// /// Determines whether the contains the /// specified key. /// /// /// The value to locate in the . /// /// /// true if the contains an element with /// the specified key; otherwise, false. /// bool Contains( TFirst key ); bool TryGetValue( TSecond key, out TFirst value ); #pragma warning disable CA1033 ICollection IDictionary.Keys => FirstIndex; ICollection IDictionary.Values => SecondIndex; bool IDictionary.ContainsKey( TFirst key ) { return Contains(key); } #pragma warning restore CA1033 } }