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


C# MetadataReader.FormatAssemblyInfo方法代码示例

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


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

示例1: DependencyFinderEngineHelper

        public DependencyFinderEngineHelper(MetadataReader metadataReader, string assemblyPath)
        {
            _reader = metadataReader;
            _assemblyLocation = assemblyPath;

            MemberDependency = new List<MemberDependency>();
            CallingAssembly = _reader.GetAssemblyInfo(assemblyPath);

            // Get assembly info
            var assemblyDefinition = _reader.GetAssemblyDefinition();

            _currentAssemblyInfo = _reader.FormatAssemblyInfo(assemblyDefinition);
            _currentAssemblyName = _reader.GetString(assemblyDefinition.Name);
        }
开发者ID:vivmishra,项目名称:dotnet-apiport,代码行数:14,代码来源:DependencyFinderEngineHelper.cs

示例2: DependencyFinderEngineHelper

        public DependencyFinderEngineHelper(IDependencyFilter assemblyFilter, MetadataReader metadataReader, IAssemblyFile file)
        {
            _assemblyFilter = assemblyFilter;
            _reader = metadataReader;
            _assemblyLocation = file.Name;

            MemberDependency = new List<MemberDependency>();
            CallingAssembly = new AssemblyInfo
            {
                AssemblyIdentity = metadataReader.FormatAssemblyInfo().ToString(),
                FileVersion = file.Version ?? string.Empty,
                TargetFrameworkMoniker = metadataReader.GetTargetFrameworkMoniker() ?? string.Empty
            };

            // Get assembly info
            var assemblyDefinition = _reader.GetAssemblyDefinition();

            _currentAssemblyInfo = _reader.FormatAssemblyInfo(assemblyDefinition);
            _currentAssemblyName = _reader.GetString(assemblyDefinition.Name);
        }
开发者ID:MetSystem,项目名称:dotnet-apiport,代码行数:20,代码来源:DependencyFinderEngineHelper.cs

示例3: AddReferencedAssemblies

        /// <summary>
        /// Add all assemblies that were referenced to the referenced assembly dictionary.  By default, 
        /// we add every referenced assembly and will remove the ones that are actually referenced when 
        /// all submitted assemblies are processed.
        /// </summary>
        /// <param name="metadataReader"></param>
        private void AddReferencedAssemblies(MetadataReader metadataReader)
        {
            var assemblyReferences = metadataReader.AssemblyReferences
                                        .Select(metadataReader.GetAssemblyReference)
                                        .Select(metadataReader.FormatAssemblyInfo);

            var assemblyName = metadataReader.FormatAssemblyInfo();

            foreach (var reference in assemblyReferences)
            {
                _unresolvedAssemblies.AddOrUpdate(
                    reference.ToString(),
                    new HashSet<string>(StringComparer.Ordinal) { assemblyName.ToString() },
                    (key, existing) =>
                    {
                        lock (existing)
                        {
                            existing.Add(assemblyName.ToString());
                        }

                        return existing;
                    });
            }
        }
开发者ID:MetSystem,项目名称:dotnet-apiport,代码行数:30,代码来源:ReflectionMetadataDependencyInfo.cs


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