public static Package Create(byte[] bytes, string source) { BytePackage package = new BytePackage(); package._bytes = bytes; package.Source = source; return(package); }
private void Poll() { Logger.Info(this, "Started"); while (true) { Pauze(); try { Update newVersion = this._proxy.Check(this.Application.Name, this.Application.CurrentVersion); if (newVersion != null) { Logger.Info(this, "Server has a new version " + newVersion.Number + " for " + newVersion.Application); byte[] bytes = this._proxy.Download(newVersion); Package newPackage = BytePackage.Create(bytes, Proxy.DownloadUrl(newVersion)); this.Update(newPackage); } } catch (ThreadAbortException) { Logger.Info(this, "Aborted"); break; } catch (Exception ex) { Logger.Error("Polling failed: " + ex.GetRootCause().Message); } } Logger.Info(this, "Stopped"); }
public static Package Create(byte[] bytes, string source) { BytePackage package = new BytePackage(); package._bytes = bytes; package.Source = source; return (package); }