PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/Main/src/DynamicDataDisplay/Common/Auxiliary/DictionaryExtensions.cs

#
C# | 27 lines | 25 code | 2 blank | 0 comment | 0 complexity | 63e5b6e82815a8c733f77bbba8c01781 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using Microsoft.Research.DynamicDataDisplay.Charts.Isolines;
 6
 7namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary
 8{
 9	internal static class DictionaryExtensions
10	{
11		internal static void Add<TKey, TValue>(this Dictionary<TKey, TValue> dict, TValue value, params TKey[] keys)
12		{
13			foreach (var key in keys)
14			{
15				dict.Add(key, value);
16			}
17		}
18
19		internal static void Add(this Dictionary<int, Edge> dict, Edge value, params CellBitmask[] keys)
20		{
21			foreach (var key in keys)
22			{
23				dict.Add((int)key, value);
24			}
25		}
26	}
27}