SDownload.Dialogs.UpdateAvailableDialog.UpdateAvailableDialog C# (CSharp) Method

UpdateAvailableDialog() public method

Initializes the dialog
public UpdateAvailableDialog ( String fileUrl, IReadOnlyList contracts ) : System
fileUrl String The URL of the new version to download
contracts IReadOnlyList The response received from the SDownload regarding the new version
return System
        public UpdateAvailableDialog(String fileUrl, IReadOnlyList<GithubReleaseItemContract> contracts)
        {
            InitializeComponent();

            _fileUrl = fileUrl;

            // Set newest version number
            versionNumberLabel.Text = contracts[0].Name;

            // Combine all changelogs since the current version
            var sb = new StringBuilder();
            foreach (var release in contracts)
            {
                sb.AppendLine(release.Name + "\r\n---------");
                sb.AppendLine(release.Body.Replace("-F", "-").Replace("-N", "-") + "\r\n");
            }
            changeLogBox.Text = sb.ToString();

            // Set up the buttons
            noResponseButton.Click += (sender, args) => Close();
            yesResponseButton.Click += (sender, args) => DownloadAndInstall(contracts[0].Assets[0].Size);
        }