Exemplo n.º 1
0
 /// <summary>
 /// Creates a new <see cref="ReadonlyMultikeyedDictionary{TKey1, TKey2, TValue}"/>
 /// with the <paramref name="dictionary"/> provided.
 /// </summary>
 /// <param name="dictionary">The <see cref="IMultikeyedDictionary{TKey1, TKey2, TValue}"/>
 /// which is wrapped by the <see cref="ReadonlyMultikeyedDictionary{TKey1, TKey2, TValue}"/>.</param>
 public ReadonlyMultikeyedDictionary(IMultikeyedDictionary <TKey1, TKey2, TValue> dictionary)
 {
     if (dictionary == null)
     {
         throw new ArgumentNullException("dictionary");
     }
     this.dataCopy = dictionary;
 }
Exemplo n.º 2
0
        public static IMultikeyedDictionary <TKey2, TKey3, TValue> FilterToDictionary <TKey1, TKey2, TKey3, TValue>(this IMultikeyedDictionary <TKey1, TKey2, TKey3, TValue> dict, TKey1 key1Filter)
        {
            var result = new MultikeyedDictionary <TKey2, TKey3, TValue>();

            foreach (var ksvp in dict.Filter(key1Filter))
            {
                result.Add(ksvp.Keys.Key2, ksvp.Keys.Key3, ksvp.Value);
            }
            return(result);
        }
Exemplo n.º 3
0
 public static IEnumerable <KeysValuePair <MultikeyedDictionaryKeys <TKey1, TKey2, TKey3>, TValue> > Filter <TKey1, TKey2, TKey3, TValue>(this IMultikeyedDictionary <TKey1, TKey2, TKey3, TValue> dict, TKey1 key1Filter)
 {
     return(from ksvp in dict
            where ksvp.Keys.Key1.Equals(key1Filter)
            select ksvp);
 }