public async void DownloadUpdateClick() { await Task.Run(() => { CLog.Here().Information($"AppUpdaterService - DownloadUpdate : [ Download for Update... ]"); AvailableUpdate?.ClosePopUp(); // this is async so that it can grab the download file name from the server SparkleInst.DownloadStarted -= CBStartedDownloading; SparkleInst.DownloadStarted += CBStartedDownloading; SparkleInst.DownloadFinished -= CBFinishedDownloading; SparkleInst.DownloadFinished += CBFinishedDownloading; SparkleInst.DownloadHadError -= CBDownloadError; SparkleInst.DownloadHadError += CBDownloadError; SparkleInst.DownloadMadeProgress -= CBDownloadMadeProgress; SparkleInst.DownloadMadeProgress += CBDownloadMadeProgress; SparkleInst.DownloadCanceled -= CBDownloadCanceled; SparkleInst.DownloadCanceled += CBDownloadCanceled; }); await SparkleInst.InitAndBeginDownload(UpdateInfo.Updates.First()); // ok, the file is downloading now }
public async void DownloadUpdateClick() { // this is async so that it can grab the download file name from the server SparkleInst.DownloadStarted -= CBStartedDownloading; SparkleInst.DownloadStarted += CBStartedDownloading; SparkleInst.DownloadFinished -= CBFinishedDownloading; SparkleInst.DownloadFinished += CBFinishedDownloading; SparkleInst.DownloadHadError -= CBDownloadError; SparkleInst.DownloadHadError += CBDownloadError; SparkleInst.DownloadMadeProgress += CBDownloadMadeProgress; await SparkleInst.InitAndBeginDownload(UpdateInfo.Updates.First()); // ok, the file is downloading now }