Exemplo n.º 1
0
        /// <summary>
        /// Add's directory to the package.
        /// </summary>
        /// <param name="sourceDirectoryPath">Path of the source directory to be copied.</param>
        /// <param name="destinationDirectory">Name of the directory that the source directory will be copied to.</param>
        /// <param name="filterOptions">Apply filtering options for directories and files inside directories.</param>
        /// <returns></returns>
        public PackageTask AddDirectoryToPackage(string sourceDirectoryPath, string destinationDirectory, Action <FilterOptions> filterOptions)
        {
            FilterOptions fo = new FilterOptions();

            filterOptions.Invoke(fo);

            SourcePackagingInfo directoryToPackage = new SourcePackagingInfo(
                SourceType.Directory,
                sourceDirectoryPath,
                destinationDirectory)
            {
                Recursive = fo.Recursive
            };

            directoryToPackage.FileFilters.AddRange(fo.FileFilters);
            directoryToPackage.DirectoryFilters.AddRange(fo.DirectoryFilters);
            _sourcePackagingInfos.Add(directoryToPackage);
            return(this);
        }