public static XElement Show(UpdatableAttribute product, UpdateInfo oldUpdate, ReadOnlyCollection<string> updateFiles, string baseDir) { using (var form = new EntryForm()) { if (oldUpdate == null) { form.ClientSize = new Size(form.splitContainerControl1.Panel2.Width, form.ClientSize.Height); form.splitContainerControl1.PanelVisibility = SplitPanelVisibility.Panel2; } else { form.oldUpdate.ShowOldFiles(oldUpdate, updateFiles, baseDir); } form.newUpdate.ShowNewFiles(product.CurrentVersion, DefaultDescription, updateFiles, baseDir, oldUpdate); form.Text = "Update " + product.ProductName; if (form.ShowDialog() == DialogResult.Cancel) return null; var newVersion = new UpdateVersion(DateTime.Now, product.CurrentVersion, form.newUpdate.Description); return new XElement("Update", new XAttribute("Name", product.ProductName), new XElement("Versions", newVersion.ToXml(), oldUpdate == null ? null : oldUpdate.Versions.Select(v => v.ToXml()) ) //The new files are added later ); } }
///<summary>Creates a new UpdateChecker for the product described by an UpdatableAttribute instance.</summary> ///<returns>An UpdateChecker instance that for the program described by the attribute, or null if updates are not configured in ShomreiTorahConfig.xml.</returns> public static UpdateChecker Create(UpdatableAttribute attribute) { if (attribute == null) throw new ArgumentNullException("attribute"); if (UpdateConfig.Standard == null) return null; return new UpdateChecker(attribute); }
public Publisher(UpdatableAttribute product, UpdateInfo oldUpdate, XElement xml, ReadOnlyCollection<string> updateFiles, string basePath) { this.oldUpdate = oldUpdate; this.xml = xml; this.updateFiles = updateFiles; this.basePath = basePath; this.product = product; remoteBaseFolder = Combine(UpdateConfig.Standard.RemotePath, product.ProductName + "/"); }
private UpdateChecker(UpdatableAttribute attribute) { ProductName = attribute.ProductName; CurrentVersion = attribute.CurrentVersion; }