当前位置: 首页>>代码示例>>C#>>正文


C# IPackage.GetSatelliteFiles方法代码示例

本文整理汇总了C#中IPackage.GetSatelliteFiles方法的典型用法代码示例。如果您正苦于以下问题:C# IPackage.GetSatelliteFiles方法的具体用法?C# IPackage.GetSatelliteFiles怎么用?C# IPackage.GetSatelliteFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPackage的用法示例。


在下文中一共展示了IPackage.GetSatelliteFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExpandFiles

        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 (PackageHelper.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();
                }
            }
        }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:35,代码来源:PackageManager.cs

示例2: RemoveFiles

        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 (PackageHelper.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);
        }
开发者ID:sistoimenov,项目名称:NuGet2,代码行数:18,代码来源:PackageManager.cs

示例3: RemoveFiles

        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);
            }
        }
开发者ID:themotleyfool,项目名称:NuGet,代码行数:16,代码来源:PackageManager.cs


注:本文中的IPackage.GetSatelliteFiles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。