コード例 #1
0
        /// <summary>
        /// Parses gitApi text and gets the latest release version of the program the gitApi text is for
        /// </summary>
        /// <param name="aquiredGitText">The text that was successfully read from github</param>
        /// <returns>an int of the latest release version, as a whole number without decimals</returns>
        public static string GetLatestVersion(string aquiredGitText)
        {
            var    gitApi        = GitApi.FromJson(aquiredGitText);
            string latestRelease = gitApi[0].TagName;

            return(latestRelease);
        }
コード例 #2
0
        /// <summary>
        /// Reads gitApi text and gets all of the download urls associated with the latest release
        /// </summary>
        /// <returns>a list of download url strings</returns>
        private List <string> GetDownloadURLs()
        {
            int           i         = -1;
            List <string> downloads = new List <string>();
            var           gitApi    = GitApi.FromJson(AquiredGitApiText);

            foreach (var a in gitApi[0].Assets)
            {
                i++;
                if (GitFileIndexsToDownload != null && !GitFileIndexsToDownload.Contains(i))
                {
                    continue;
                }

                Log.Output("Downloading " + a.BrowserDownloadUrl.ToString());
                downloads.Add(a.BrowserDownloadUrl.ToString());
            }

            return(downloads);
        }