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 )); } }
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 + "/"); }
public ModelAttributesInfo(Type modelType) { QueryAuthAttributes = GetAuthAttributesOfClassOrDirectTopClass <QueryAuthAttribute>(modelType); QueryEntryAuthAttributes = GetAuthAttributesOfClassOrDirectTopClass <QueryEntryAuthAttribute>(modelType); UpdateAuthAttributes = GetAuthAttributesOfClassOrDirectTopClass <UpdateAuthAttribute>(modelType); RemoveAuthAttributes = GetAuthAttributesOfClassOrDirectTopClass <RemoveAuthAttribute>(modelType); CreateAuthAttributes = GetAuthAttributesOfClassOrDirectTopClass <CreateAuthAttribute>(modelType); CreateEventAttributes = GetHookAttributeOfClassAndTopClasses <CreateEventAttribute>(modelType); UpdateEventAttributes = GetHookAttributeOfClassAndTopClasses <UpdateEventAttribute>(modelType); RemoveEventAttributes = GetHookAttributeOfClassAndTopClasses <RemoveEventAttribute>(modelType); QueryFunctionAttribute = modelType.GetCustomAttribute <QueryFunctionAttribute>(false); QueryFunctionAttribute?.Compile(modelType); UpdatableAttribute = modelType.GetCustomAttribute <UpdatableAttribute>(false); }