IsSatellitePackage() публичный статический Метод

public static IsSatellitePackage ( IPackage package, IPackageRepository repository, FrameworkName targetFramework, IPackage &runtimePackage ) : bool
package IPackage
repository IPackageRepository
targetFramework FrameworkName
runtimePackage IPackage
Результат bool
        private void RemoveFiles(IPackage package)
        {
            string packageDirectory = PathResolver.GetPackageDirectory(package);

            // Remove resource files
            FileSystem.DeleteFiles(package.GetFiles(), packageDirectory);

            // If this is a Satellite Package, then remove the files from the related runtime package folder too
            IPackage runtimePackage;

            if (PackageUtility.IsSatellitePackage(package, LocalRepository, targetFramework: null, runtimePackage: out runtimePackage))
            {
                var satelliteFiles = package.GetSatelliteFiles();
                var runtimePath    = PathResolver.GetPackageDirectory(runtimePackage);
                FileSystem.DeleteFiles(satelliteFiles, runtimePath);
            }
        }
Пример #2
0
        private void RemoveFiles(IPackage package)
        {
            string packageDirectory = PathResolver.GetPackageDirectory(package);

            // If this is a Satellite Package, then remove the files from the related runtime package folder too
            IPackage runtimePackage;

            if (PackageUtility.IsSatellitePackage(package, LocalRepository, targetFramework: null, runtimePackage: out runtimePackage))
            {
                var satelliteFiles = package.GetSatelliteFiles();
                var runtimePath    = PathResolver.GetPackageDirectory(runtimePackage);
                FileSystem.DeleteFiles(satelliteFiles, runtimePath);
            }

            // Remove package files
            // IMPORTANT: This has to be done AFTER removing satellite files from runtime package,
            // because starting from 2.1, we read satellite files directly from package files, instead of .nupkg
            FileSystem.DeleteFiles(package.GetFiles(), packageDirectory);
        }
Пример #3
0
        private void ExpandFiles(IPackage package)
        {
            var batchProcessor = FileSystem as IBatchProcessor <string>;

            try
            {
                var files = package.GetFiles().ToList();
                if (batchProcessor != null)
                {
                    // Notify the batch processor that the files are being added. This is to allow source controlled file systems
                    // to manage previously uninstalled files.
                    batchProcessor.BeginProcessing(files.Select(p => p.Path), PackageAction.Install);
                }

                string packageDirectory = PathResolver.GetPackageDirectory(package);

                // Add files
                FileSystem.AddFiles(files, packageDirectory);

                // If this is a Satellite Package, then copy the satellite files into the related runtime package folder too
                IPackage runtimePackage;
                if (PackageUtility.IsSatellitePackage(package, LocalRepository, targetFramework: null, runtimePackage: out runtimePackage))
                {
                    var satelliteFiles = package.GetSatelliteFiles();
                    var runtimePath    = PathResolver.GetPackageDirectory(runtimePackage);
                    FileSystem.AddFiles(satelliteFiles, runtimePath);
                }
            }
            finally
            {
                if (batchProcessor != null)
                {
                    batchProcessor.EndProcessing();
                }
            }
        }