You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1 KiB

  1. using Minio.Client.Xml;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Minio.Client
  8. {
  9. public class ItemEnumerable : IEnumerable<Item>
  10. {
  11. internal string Bucket { get; set; }
  12. private bool IsRunning = true;
  13. LinkedList<Item> items = new LinkedList<Item>();
  14. public ItemEnumerable()
  15. {
  16. }
  17. public IEnumerator<Item> GetEnumerator()
  18. {
  19. while (IsRunning)
  20. {
  21. if (items.Count == 0)
  22. {
  23. populate();
  24. }
  25. if (items.Count > 0)
  26. {
  27. Item item = items.First();
  28. items.RemoveFirst();
  29. yield return item;
  30. }
  31. else
  32. {
  33. IsRunning = false;
  34. }
  35. }
  36. }
  37. System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
  38. {
  39. throw new NotImplementedException();
  40. }
  41. internal void populate()
  42. {
  43. }
  44. }
  45. }