AerialForWindows.Updates.UpdateManager.CheckForUpdatesAsync C# (CSharp) Method

CheckForUpdatesAsync() public method

public CheckForUpdatesAsync ( ) : Task
return Task
        public async Task CheckForUpdatesAsync() {
            IReadOnlyCollection<ReleaseInfo> newReleases;
            try {
                newReleases = await _reader.GetReleaseInfosAsync();
            } catch {
                return;
            }

            // remove re-published versions
            foreach (var release in newReleases) {
                _releases.RemoveAll(r => r.Version == release.Version);
            }

            _releases.AddRange(newReleases);
            _releases.Sort((r1, r2) => r2.Version.CompareTo(r1.Version));
            if (_releases.Any(r => r.Version > _currentVersion)) {
                OnUpdatesAvailable();
            }
        }