UnmodifiableDictionaryProxy.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.Collections;
  5. namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections
  6. {
  7. public class UnmodifiableDictionaryProxy
  8. : UnmodifiableDictionary
  9. {
  10. private readonly IDictionary d;
  11. public UnmodifiableDictionaryProxy(IDictionary d)
  12. {
  13. this.d = d;
  14. }
  15. public override bool Contains(object k)
  16. {
  17. return d.Contains(k);
  18. }
  19. public override void CopyTo(Array array, int index)
  20. {
  21. d.CopyTo(array, index);
  22. }
  23. public override int Count
  24. {
  25. get { return d.Count; }
  26. }
  27. public override IDictionaryEnumerator GetEnumerator()
  28. {
  29. return d.GetEnumerator();
  30. }
  31. public override bool IsFixedSize
  32. {
  33. get { return d.IsFixedSize; }
  34. }
  35. public override bool IsSynchronized
  36. {
  37. get { return d.IsSynchronized; }
  38. }
  39. public override object SyncRoot
  40. {
  41. get { return d.SyncRoot; }
  42. }
  43. public override ICollection Keys
  44. {
  45. get { return d.Keys; }
  46. }
  47. public override ICollection Values
  48. {
  49. get { return d.Values; }
  50. }
  51. protected override object GetValue(object k)
  52. {
  53. return d[k];
  54. }
  55. }
  56. }
  57. #pragma warning restore
  58. #endif