1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2024-11-14 17:42:47 +01:00
TweetDuck/Updates/FormUpdateDownload.cs

32 lines
754 B
C#

using System;
using System.Windows.Forms;
using TweetLib.Core.Systems.Updates;
namespace TweetDuck.Updates {
sealed partial class FormUpdateDownload : Form {
private readonly UpdateInfo updateInfo;
public FormUpdateDownload(UpdateInfo info) {
InitializeComponent();
this.updateInfo = info;
Text = "Updating " + Program.BrandName;
labelDescription.Text = $"Downloading version {info.VersionTag}...";
timerDownloadCheck.Start();
}
private void btnCancel_Click(object sender, EventArgs e) {
Close();
}
private void timerDownloadCheck_Tick(object sender, EventArgs e) {
if (updateInfo.DownloadStatus.IsFinished(false)) {
timerDownloadCheck.Stop();
DialogResult = DialogResult.OK;
Close();
}
}
}
}