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


C# IPackage.GetLibFiles方法代码示例

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


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

示例1: Validate

        public IEnumerable<PackageVerifierIssue> Validate(IPackageRepository packageRepo, IPackage package, IPackageVerifierLogger logger)
        {
            if (!package.IsSatellitePackage())
            {
                IEnumerable<string> allXmlFiles =
                    from file in package.GetLibFiles()
                    select file.Path into path
                    where path.EndsWith(".xml", StringComparison.OrdinalIgnoreCase)
                    select path;

                foreach (IPackageFile current in package.GetLibFiles())
                {
                    string assemblyPath = current.Path;
                    // TODO: Does this need to check for just managed code?
                    if (assemblyPath.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
                    {
                        string docFilePath = Path.ChangeExtension(assemblyPath, ".xml");
                        if (!allXmlFiles.Contains(docFilePath, StringComparer.OrdinalIgnoreCase))
                        {
                            yield return PackageIssueFactory.AssemblyHasNoDocFile(assemblyPath);
                        }
                    }
                }
            }
            yield break;
        }
开发者ID:modulexcite,项目名称:DnxTools,代码行数:26,代码来源:AssemblyHasDocumentFileRule.cs

示例2: GetPackageDefinition

        public IEnumerable<string> GetPackageDefinition(IPackage package, bool includePreRelease)
        {
            _nugetFactory.GetPackageManager().InstallPackage(package, true, includePreRelease);

            var packageDir = _nugetFactory.GetPackageManager().PathResolver.GetPackageDirectory(package);
            var dllFiles = package.GetLibFiles().Select(f => Path.Combine(_arguments.GetInstallationDirectory(), packageDir, f.Path));

            var result = _packageReader.ReadPackage(dllFiles);
            return result;
        }
开发者ID:run00,项目名称:NuProduct,代码行数:10,代码来源:Runner.cs

示例3: GetFiles

 private static IEnumerable<Tuple<IPackageFile, string>> GetFiles(IPackage package)
 {
     if (package.GetLibFiles().IsEmpty() && package.GetContentFiles().IsEmpty()) {
         foreach (var packageFile in package.GetFiles()) {
             yield return new Tuple<IPackageFile, string>(packageFile, packageFile.Path);
         }
     } else {
         // TODO: net40 is hard-coded. Some day more frameworks should be supported
         foreach (var packageFile in package.GetLibFiles()) {
             yield return new Tuple<IPackageFile, string>(packageFile, packageFile.Path.Substring(@"lib\net40\".Length));
         }
         foreach (var packageFile in package.GetContentFiles()) {
             yield return new Tuple<IPackageFile, string>(packageFile, packageFile.Path.Substring(@"content\".Length));
         }
     }
 }
开发者ID:thoemmi,项目名称:NuUpdate,代码行数:16,代码来源:UpdateManager.cs

示例4: ProcessSymbolsAsync

        public async Task ProcessSymbolsAsync(IPackage package, string symbolSourceUri)
        {
            var files = package.GetLibFiles().Where(f => f.Path.EndsWith("pdb", StringComparison.InvariantCultureIgnoreCase));

            using (var tempFolder = CreateTempFolderForPackage(package))
            {
                foreach (var file in files)
                {
                    var filePath = Path.Combine(tempFolder.Path, file.Path);
                    var fileDir = Path.GetDirectoryName(filePath);

                    if (fileDir != null && !Directory.Exists(fileDir))
                    {
                        Directory.CreateDirectory(fileDir);
                    }

                    using (var writeStream = File.Open(filePath, FileMode.Create, FileAccess.Write))
                    {
                        using (var readStream = file.GetStream())
                        {
                            await readStream.CopyToAsync(writeStream);
                        }
                    }

                    await ProcessSymbolFileAsync(package, filePath, symbolSourceUri);
                }
            }
        }
开发者ID:jjchiw,项目名称:NuGet.Lucene,代码行数:28,代码来源:SymbolSource.cs

示例5: UnpackPackage

        private void UnpackPackage(string folder, IPackage package)
        {
            var framework = new FrameworkName(".NETFramework,Version=v4.0");
            var libFiles = package.GetLibFiles();

            foreach (var file in libFiles)
            {
                if (file.TargetFramework.Version != framework.Version || file.TargetFramework.Identifier != framework.Identifier)
                    continue;

                string fileOut = Path.Combine(folder, file.EffectivePath);

                if (Path.GetExtension(fileOut) == ".dll")
                    UnpackFile(fileOut, file);
            }
        }
开发者ID:CloudMorph,项目名称:cloudmorph-fabric,代码行数:16,代码来源:LibraryService.cs


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