IAppVersion.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using System.Threading.Tasks;
  3. namespace InABox.Mobile
  4. {
  5. internal 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. /// <summary>
  21. /// LatestVersion plugin
  22. /// </summary>
  23. public interface IAppVersion
  24. {
  25. /// <summary>
  26. /// Gets the version number of the current app's installed version.
  27. /// </summary>
  28. /// <value>The current app's installed version number.</value>
  29. string InstalledVersionNumber { get; }
  30. /// <summary>
  31. /// Checks if the current app is the latest version available in the public store.
  32. /// </summary>
  33. /// <returns>True if the current app is the latest version available, false otherwise.</returns>
  34. Task<bool> IsUsingLatestVersion();
  35. /// <summary>
  36. /// Gets the version number of the current app's latest version available in the public store.
  37. /// </summary>
  38. /// <returns>The current app's latest version number.</returns>
  39. Task<string> GetLatestVersionNumber();
  40. /// <summary>
  41. /// Gets the version number of an app's latest version available in the public store.
  42. /// </summary>
  43. /// <returns>The specified app's latest version number</returns>
  44. /// <param name="appName">Name of the app to get.</param>
  45. Task<string> GetLatestVersionNumber(string appName);
  46. /// <summary>
  47. /// Opens the current app in the public store.
  48. /// </summary>
  49. Task OpenAppInStore();
  50. /// <summary>
  51. /// Opens an app in the public store.
  52. /// </summary>
  53. /// <param name="appName">Name of the app to open.</param>
  54. Task OpenAppInStore(string appName);
  55. }
  56. }