Exemple #1
0
        // Returns a string array of urls to download files
        public static async Task <string[]> GetUpdateUrls(Guid projectId, DateTime dateUpdate)
        {
            try
            {
                var releasesClient = new ReleasesClient("https://releases.eclipseorigins.com");

                var releaseNewest = await releasesClient.GetReleasesAsync(projectId, 0, 1, minimumDate : dateUpdate);

                int cntReleases = releaseNewest.TotalCount;

                string[] urlReleases = new string[cntReleases];

                // Check if the versions match
                if (releaseNewest.Items[0].Id == ConfigHandler.ConfigFile.Version.ID)
                {
                    return(null);
                }

                // Get each page of updates
                int i = 0;
                while (i < cntReleases)
                {
                    var releases = await releasesClient.GetReleasesAsync(projectId, 0, 1);

                    for (int r = 0; r < releases.Items.Count; ++r)
                    {
                        urlReleases[r + i] = releases.Items[r].GetDownloadUrl();
                    }

                    i += countPage;
                }

                return(urlReleases);
            }
            catch
            {
                return(null);
            }
        }
Exemple #2
0
        private static async Task TestReleases()
        {
            var releasesClient = new ReleasesClient("https://releases.eclipseorigins.com");

            var releases = await releasesClient.GetReleasesAsync(new Guid("0836bbd7-d9b4-466a-a566-7670bd568e3b"), 0, 1);

            if (releases.Items.Count > 0)
            {
                var latestRelease = releases.Items[0];

                var downloadUrl = latestRelease.GetDownloadUrl();
            }
        }
Exemple #3
0
        public static async Task <string> GetLatestVersion(Guid projectId)
        {
            try
            {
                var releasesClient = new ReleasesClient("https://releases.eclipseorigins.com");

                var releaseLocal = await releasesClient.GetReleasesAsync(projectId, 0, 1);

                return((releaseLocal.Items.Count == 0) ? "" : releaseLocal.Items[0].Version);
            } catch {
                return("");
            }
        }