Пример #1
0
        public void FindGithubLatestTest()
        {
            Release?libraries = Release.FindGithubLatest("Libraries");

            libraries.ShouldNotBeNull("Libraries Version");
            Version?commonVersion = ReflectionUtility.GetVersion(typeof(Release).Assembly);

            libraries.Version.CompareTo(commonVersion).ShouldBeLessThanOrEqualTo(0, "Libraries Version <= Local Common Version");
        }
Пример #2
0
        private void UpdateChecker_DoWork(object sender, DoWorkEventArgs e)
        {
            Release?latest = Release.FindGithubLatest(this.repository);

            if (latest != null)
            {
                Version?appVersion = ReflectionUtility.GetVersion(this.callingAssembly);
                if (latest.Version > appVersion)
                {
                    e.Result = latest;
                }
            }
        }
Пример #3
0
        private async void ExtendedDialog_LoadedAsync(object sender, RoutedEventArgs e)
        {
            string  repository = this.repository;
            Release?latest     = await Task.Run(() => Release.FindGithubLatest(repository)).ConfigureAwait(true);

            if (latest != null && this.IsLoaded)
            {
                Version?appVersion = ReflectionUtility.GetVersion(this.callingAssembly);
                if (latest.Version > appVersion)
                {
                    this.updateLink.Tag        = latest;
                    this.updateLink.Content    = $"★ Version {latest.Version} update available!";
                    this.updateLink.Visibility = Visibility.Visible;
                }
            }
        }