CacheObject.cs 744 B

12345678910111213141516171819202122232425262728293031323334
  1. using Muchinfo.MTPClient.Infrastructure.Enums;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Muchinfo.MTPClient.Infrastructure.Cache
  5. {
  6. public class CacheObject : IDisposable
  7. {
  8. public DateTime CacheTime { get; set; }
  9. public CacheType CacheType
  10. {
  11. get;
  12. set;
  13. }
  14. public List<object> CacheList { get; set; }
  15. public CacheObject(CacheType type)
  16. {
  17. this.CacheType = type;
  18. }
  19. public void Dispose()
  20. {
  21. this.CacheTime = DateTime.MinValue;
  22. if (this.CacheList != null)
  23. {
  24. this.CacheList.Clear();
  25. this.CacheList = null;
  26. }
  27. }
  28. }
  29. }