UnmodifiableList.cs 1.3 KB

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