// forced pull internal bool ForcePull() { var download = new ClientDownload(new Guid().ToString("D"), Program.License.User, Program.License.Password); //download.FastPull(); var bytes = download.PullZip(); if (bytes == null || bytes.Length == 0) { throw new Exception("Pull failed. Try later."); } Program.Start.PullBytes = bytes; if (IsTaskCanceled) { _failed = true; _TerminatePull(download); return(false); } if (download.IsDenied) { _failed = true; Common.ShowNotification("Pull has been denied."); _TerminatePull(download); return(false); } return(_TerminatePull(download)); }
private void StartPull() { Task.Factory.StartNew(() => { try { var clientDownload = new ClientDownload(new Guid().ToString("D"), Program.License.User, Program.License.Password); PullBytes = clientDownload.PullZip(); } catch (Exception ex) { PullException = ex; } }); }