DiffPackage.cs 874 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. namespace Update.Core.Entities
  3. {
  4. /// <summary>
  5. /// 增量跟新包
  6. /// </summary>
  7. public class DiffPackage : IPackage, IComparable<DiffPackage>
  8. {
  9. /// <summary>
  10. /// 更新包文件名
  11. /// </summary>
  12. public string FileName { get; set; }
  13. /// <summary>
  14. /// 起始版本
  15. /// </summary>
  16. public Version From { get; set; }
  17. /// <summary>
  18. /// 目标版本
  19. /// </summary>
  20. public Version To { get; set; }
  21. /// <summary>
  22. /// 比较
  23. /// </summary>
  24. /// <param name="other">要比较的更新包</param>
  25. /// <returns>如果较新返回正数,较旧返回负数,相等返回 0</returns>
  26. public int CompareTo(DiffPackage other)
  27. {
  28. return this.From.CompareTo(other.From);
  29. }
  30. }
  31. }