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 )); } }