IAppVersion.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Threading.Tasks;
  3. namespace InABox.Mobile
  4. {
  5. public class LatestVersionException : Exception
  6. {
  7. public LatestVersionException(string message)
  8. : base(message)
  9. {
  10. }
  11. public LatestVersionException(Exception innerException)
  12. : base("", innerException)
  13. {
  14. }
  15. public LatestVersionException(string message, Exception innerException)
  16. : base(message, innerException)
  17. {
  18. }
  19. }
  20. public class AppInfo
  21. {
  22. public String Version { get; set; }
  23. public DateTime Date { get; set; }
  24. public String Notes { get; set; }
  25. }
  26. /// <summary>
  27. /// LatestVersion plugin
  28. /// </summary>
  29. public interface IAppVersion
  30. {
  31. /// <summary>
  32. /// Gets the version number of the current app's installed version.
  33. /// </summary>
  34. /// <value>The current app's installed version number.</value>
  35. string InstalledVersionNumber { get; }
  36. /// <summary>
  37. /// Checks if the current app is the latest version available in the public store.
  38. /// </summary>
  39. /// <returns>True if the current app is the latest version available, false otherwise.</returns>
  40. Task<bool> IsUsingLatestVersion();
  41. Task<AppInfo> GetLatestVersion(bool force);
  42. /// <summary>
  43. /// Opens the current app in the public store.
  44. /// </summary>
  45. Task OpenAppInStore();
  46. }
  47. }