public async Task <Info> CheckForUpdatesAsync() { var latestInfo = await GetLatestCardInfo().ConfigureAwait(false); var currentVersion = Settings.ActiveCardDataVersion != null ? Settings.ActiveCardDataVersion : Info.Current.CardDataVersion; if (latestInfo.CardDataVersion > currentVersion && latestInfo.CardDataCompatibleVersion <= currentVersion) {//remote card data is newer and compatible DataUpdateAvailable?.Invoke(this, latestInfo); } return(latestInfo); }
/// <summary> /// Called when data update is available. /// </summary> /// <param name="changedFiles">The changed files.</param> internal static void OnDataUpdateAvailable(Collection <SerializableDatafile> changedFiles) { Trace($"(ChangedFiles = {changedFiles.Count})"); DataUpdateAvailable?.ThreadSafeInvoke(null, new DataUpdateAvailableEventArgs(changedFiles)); }