OrderedDictionaryEnumerator.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace LitJson
  5. {
  6. internal class OrderedDictionaryEnumerator : IEnumerator, IDictionaryEnumerator
  7. {
  8. public OrderedDictionaryEnumerator(IEnumerator<KeyValuePair<string, JsonData>> enumerator)
  9. {
  10. this.list_enumerator = enumerator;
  11. }
  12. public object Current
  13. {
  14. get
  15. {
  16. return this.Entry;
  17. }
  18. }
  19. public DictionaryEntry Entry
  20. {
  21. get
  22. {
  23. KeyValuePair<string, JsonData> keyValuePair = this.list_enumerator.Current;
  24. return new DictionaryEntry(keyValuePair.Key, keyValuePair.Value);
  25. }
  26. }
  27. public object Key
  28. {
  29. get
  30. {
  31. KeyValuePair<string, JsonData> keyValuePair = this.list_enumerator.Current;
  32. return keyValuePair.Key;
  33. }
  34. }
  35. public object Value
  36. {
  37. get
  38. {
  39. KeyValuePair<string, JsonData> keyValuePair = this.list_enumerator.Current;
  40. return keyValuePair.Value;
  41. }
  42. }
  43. public bool MoveNext()
  44. {
  45. return this.list_enumerator.MoveNext();
  46. }
  47. public void Reset()
  48. {
  49. this.list_enumerator.Reset();
  50. }
  51. private IEnumerator<KeyValuePair<string, JsonData>> list_enumerator;
  52. }
  53. }