本文整理汇总了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();
}
}
}
示例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);
}
示例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);
}
}