EnumerableProxy.cs 731 B

123456789101112131415161718192021222324252627282930313233
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. #pragma warning disable
  3. using System;
  4. using System.Collections.Generic;
  5. namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections
  6. {
  7. internal sealed class EnumerableProxy<T>
  8. : IEnumerable<T>
  9. {
  10. private readonly IEnumerable<T> m_target;
  11. internal EnumerableProxy(IEnumerable<T> target)
  12. {
  13. if (target == null)
  14. throw new ArgumentNullException(nameof(target));
  15. m_target = target;
  16. }
  17. System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
  18. {
  19. return m_target.GetEnumerator();
  20. }
  21. public IEnumerator<T> GetEnumerator()
  22. {
  23. return m_target.GetEnumerator();
  24. }
  25. }
  26. }
  27. #pragma warning restore
  28. #endif