/// <summary>
/// Checks to see if the program has updated and shows a dialog if so.
/// </summary>
/// <param name="dialogService">The dialog service to use for progress and result dialogs</param>
/// <returns></returns>
public static async Task CheckChangelog(MetroDialogService dialogService)
{
var settings = SettingsProvider.Load<GeneralSettings>();
var currentVersion = Assembly.GetExecutingAssembly().GetName().Version;
if ((settings.LastRanVersion != null) && (currentVersion > settings.LastRanVersion))
{
Logger.Info("Updated from {0} to {1}, showing changelog.", settings.LastRanVersion, currentVersion);
// Ask the user whether he/she wants to see what's new
var showChanges = await dialogService.
ShowQuestionMessageBox("New version installed",
$"Artemis has recently updated from version {settings.LastRanVersion} to {currentVersion}. \n" +
"Would you like to see what's new?");
// If user wants to see changelog, show it to them
if ((showChanges != null) && showChanges.Value)
await ShowChanges(dialogService, currentVersion);
}
settings.LastRanVersion = currentVersion;
settings.Save();
}