PageRenderTime 138ms CodeModel.GetById 28ms RepoModel.GetById 6ms 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
Possible License(s): CC-BY-SA-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Research.DynamicDataDisplay.Charts.Isolines;
  6. namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary
  7. {
  8. internal static class DictionaryExtensions
  9. {
  10. internal static void Add<TKey, TValue>(this Dictionary<TKey, TValue> dict, TValue value, params TKey[] keys)
  11. {
  12. foreach (var key in keys)
  13. {
  14. dict.Add(key, value);
  15. }
  16. }
  17. internal static void Add(this Dictionary<int, Edge> dict, Edge value, params CellBitmask[] keys)
  18. {
  19. foreach (var key in keys)
  20. {
  21. dict.Add((int)key, value);
  22. }
  23. }
  24. }
  25. }