UnmodifiableListProxy.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 UnmodifiableListProxy
  8. : UnmodifiableList
  9. {
  10. private readonly IList l;
  11. public UnmodifiableListProxy(IList l)
  12. {
  13. this.l = l;
  14. }
  15. public override bool Contains(object o)
  16. {
  17. return l.Contains(o);
  18. }
  19. public override void CopyTo(Array array, int index)
  20. {
  21. l.CopyTo(array, index);
  22. }
  23. public override int Count
  24. {
  25. get { return l.Count; }
  26. }
  27. public override IEnumerator GetEnumerator()
  28. {
  29. return l.GetEnumerator();
  30. }
  31. public override int IndexOf(object o)
  32. {
  33. return l.IndexOf(o);
  34. }
  35. public override bool IsFixedSize
  36. {
  37. get { return l.IsFixedSize; }
  38. }
  39. public override bool IsSynchronized
  40. {
  41. get { return l.IsSynchronized; }
  42. }
  43. public override object SyncRoot
  44. {
  45. get { return l.SyncRoot; }
  46. }
  47. protected override object GetValue(int i)
  48. {
  49. return l[i];
  50. }
  51. }
  52. }
  53. #pragma warning restore
  54. #endif