/// <summary> /// Creates a new package from a server folder /// </summary> /// <param name="owner">The owner form</param> /// <param name="connection">The connection used to retrieve the resources</param> /// <param name="folderResourceId">The folder to create the package from</param> /// <param name="zipfilename">The name of the output package file</param> /// <param name="allowedExtensions">A list of allowed extensions, set to null for all types. The special value "*" matches all unknown extensions.</param> /// <param name="removeExistingFiles">A flag indicating if the package should contain a delete instruction to delete the target area before restore</param> /// <param name="alternateTargetResourceId">The folder path where the package should be restore, set to null or empty string to use the source path</param> /// <returns></returns> public static DialogResult CreatePackage(Form owner, IServerConnection connection, string folderResourceId, string zipfilename, IEnumerable<ResourceTypes> allowedExtensions, bool removeExistingFiles, string alternateTargetResourceId) { PackageProgress pkgp = new PackageProgress(); var builder = new PackageBuilder(connection); pkgp.m_invokeObj = builder; pkgp.m_method = () => { builder.CreatePackage(folderResourceId, zipfilename, allowedExtensions, removeExistingFiles, alternateTargetResourceId); return true; }; return pkgp.ShowDialog(owner); }