private async Task checkForNewVersionAsync() { if (!_userSettings.ShowUpdateNotification) { return; } try { var hasNewVersion = await _versionChecker.NewVersionIsAvailableAsync(); if (!hasNewVersion) { return; } } catch (Exception) { //no need to do anything if version cannot be returned return; } if (string.Equals(_versionChecker.LatestVersion, _userSettings.LastIgnoredVersion)) { return; } var message = PKSimConstants.Information.NewVersionIsAvailable(_versionChecker.LatestVersion, Constants.PRODUCT_SITE); _eventPublisher.PublishEvent(new ShowNotificationEvent(PKSimConstants.UI.UpdateAvailable, message, Constants.PRODUCT_SITE_DOWNLOAD)); }
private async void showUpdateNotification() { if (!_userSettings.ShowUpdateNotification) { return; } try { var hasNewVersion = await _versionChecker.NewVersionIsAvailableAsync(); if (!hasNewVersion) { return; } } catch (Exception) { //no need to do anything if version cannot be returned return; } if (string.Equals(_versionChecker.LatestVersion, _userSettings.LastIgnoredVersion)) { return; } _view.DisplayNotification(PKSimConstants.UI.UpdateAvailable, PKSimConstants.Information.NewVersionIsAvailable(_versionChecker.LatestVersion, Constants.PRODUCT_SITE), Constants.PRODUCT_SITE_DOWNLOAD); }