Ejemplo n.º 1
0
    public void Add(K1 key1, K2 key2, V value)
    {
        this.valuesByKey1.Add(key1, value);
        this.valuesByKey2.Add(key2, value);

        BiDictionaryKeyElement <K1, K2> keyElement = new BiDictionaryKeyElement <K1, K2>(key1, key2);

        this.valuesByBothKeys.Add(keyElement, value);
    }
    public int CompareTo(BiDictionaryKeyElement <K1, K2> other)
    {
        int compareByKay1 = this.Kay1.CompareTo(other.Kay1);

        if (compareByKay1 != 0)
        {
            return(compareByKay1);
        }

        return(this.Kay2.CompareTo(other.Kay2));
    }
Ejemplo n.º 3
0
    public ICollection <V> GetByBothKeys(K1 key1, K2 key2)
    {
        BiDictionaryKeyElement <K1, K2> keyElement = new BiDictionaryKeyElement <K1, K2>(key1, key2);

        return(this.valuesByBothKeys[keyElement]);
    }