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


C# IAssemblySymbol类代码示例

本文整理汇总了C#中IAssemblySymbol的典型用法代码示例。如果您正苦于以下问题:C# IAssemblySymbol类的具体用法?C# IAssemblySymbol怎么用?C# IAssemblySymbol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: AddAssemblyLink

        protected void AddAssemblyLink(IAssemblySymbol assemblySymbol)
        {
            var name = assemblySymbol.Identity.Name;
            var navInfo = _libraryManager.LibraryService.NavInfoFactory.CreateForAssembly(assemblySymbol);

            _description.AddDescriptionText3(name, VSOBDESCRIPTIONSECTION.OBDS_TYPE, navInfo);
        }
开发者ID:robertoenbarcelona,项目名称:roslyn,代码行数:7,代码来源:AbstractDescriptionBuilder.cs

示例2: AddAssemblyLink

        protected void AddAssemblyLink(IAssemblySymbol assemblySymbol)
        {
            var name = assemblySymbol.Identity.Name;
            var navInfo = _libraryManager.GetAssemblyNavInfo(assemblySymbol);

            _description.AddDescriptionText3(name, VSOBDESCRIPTIONSECTION.OBDS_TYPE, navInfo);
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:7,代码来源:AbstractDescriptionBuilder.cs

示例3: GetAssemblyInfo

 public static string GetAssemblyInfo(IAssemblySymbol assemblySymbol)
 {
     return string.Format(
         "{0} {1}",
         FeaturesResources.Assembly,
         assemblySymbol.Identity.GetDisplayName());
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:7,代码来源:MetadataAsSourceHelpers.cs

示例4: IsSameAssemblyOrHasFriendAccessTo

 public static bool IsSameAssemblyOrHasFriendAccessTo(this IAssemblySymbol assembly, IAssemblySymbol toAssembly)
 {
     return
         Equals(assembly, toAssembly) ||
         (assembly.IsInteractive && toAssembly.IsInteractive) ||
         toAssembly.GivesAccessTo(assembly);
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:7,代码来源:IAssemblySymbolExtensions.cs

示例5: IsAccessibleWithin

 /// <summary>
 /// Checks if 'symbol' is accessible from within assembly 'within'.
 /// </summary>
 public static bool IsAccessibleWithin(
     this ISymbol symbol,
     IAssemblySymbol within,
     ITypeSymbol throughTypeOpt = null)
 {
     return IsSymbolAccessibleCore(symbol, within, throughTypeOpt, out var failedThroughTypeCheck);
 }
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:10,代码来源:ISymbolExtensions_Accessibility.cs

示例6: CompareTo

 public static IEnumerable<TypeDiff> CompareTo(this IAssemblySymbol assembly, IAssemblySymbol comparedTo)
 {
     var types = assembly.GlobalNamespace.GetTypes();
     var comparedToTypes = comparedTo.GlobalNamespace.GetTypes();
     var result = types.FullOuterJoin(comparedToTypes, NamespaceOrTypeSymbolComparer.Instance, (a, b) => a.CompareTo(b));
     return result;
 }
开发者ID:run00,项目名称:Roslyn,代码行数:7,代码来源:AssemblyExtensions.cs

示例7: ShouldCreateFromScratch

        private static bool ShouldCreateFromScratch(
            Solution solution,
            IAssemblySymbol assembly,
            string filePath,
            out string prefix,
            out VersionStamp version,
            CancellationToken cancellationToken)
        {
            prefix = null;
            version = default(VersionStamp);

            var service = solution.Workspace.Services.GetService<IAssemblySerializationInfoService>();
            if (service == null)
            {
                return true;
            }

            // check whether the assembly that belong to a solution is something we can serialize
            if (!service.Serializable(solution, filePath))
            {
                return true;
            }

            if (!service.TryGetSerializationPrefixAndVersion(solution, filePath, out prefix, out version))
            {
                return true;
            }

            return false;
        }
开发者ID:peter76111,项目名称:roslyn,代码行数:30,代码来源:SymbolTreeInfo_Serialization.cs

示例8: LoadOrCreateAsync

        /// <summary>
        /// this is for a metadata reference in a solution
        /// </summary>
        private static async Task<SymbolTreeInfo> LoadOrCreateAsync(Solution solution, IAssemblySymbol assembly, string filePath, CancellationToken cancellationToken)
        {
            // if assembly is not from a file, just create one on the fly
            if (filePath == null || !File.Exists(filePath) || !FilePathUtilities.PartOfFrameworkOrReferencePaths(filePath))
            {
                return Create(VersionStamp.Default, assembly, cancellationToken);
            }

            // if solution is not from a disk, just create one.
            if (solution.FilePath == null || !File.Exists(solution.FilePath))
            {
                return Create(VersionStamp.Default, assembly, cancellationToken);
            }

            // okay, see whether we can get one from persistence service.
            var relativePath = FilePathUtilities.GetRelativePath(solution.FilePath, filePath);
            var version = VersionStamp.Create(File.GetLastWriteTimeUtc(filePath));

            var persistentStorageService = solution.Workspace.Services.GetService<IPersistentStorageService>();

            // attempt to load from persisted state. metadata reference is solution wise information
            SymbolTreeInfo info;
            using (var storage = persistentStorageService.GetStorage(solution))
            {
                var key = PrefixMetadataSymbolTreeInfo + relativePath;
                using (var stream = await storage.ReadStreamAsync(key, cancellationToken).ConfigureAwait(false))
                {
                    if (stream != null)
                    {
                        using (var reader = new ObjectReader(stream))
                        {
                            info = ReadFrom(reader);
                            if (info != null && VersionStamp.CanReusePersistedVersion(version, info.version))
                            {
                                return info;
                            }
                        }
                    }
                }

                cancellationToken.ThrowIfCancellationRequested();

                // compute it if we couldn't load it from cache
                info = Create(version, assembly, cancellationToken);
                if (info != null)
                {
                    using (var stream = SerializableBytes.CreateWritableStream())
                    using (var writer = new ObjectWriter(stream, cancellationToken: cancellationToken))
                    {
                        info.WriteTo(writer);
                        stream.Position = 0;

                        await storage.WriteStreamAsync(key, stream, cancellationToken).ConfigureAwait(false);
                    }
                }
            }

            return info;
        }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:62,代码来源:SymbolTreeInfo_Serialization.cs

示例9: ExternAliasRecord

        public ExternAliasRecord(string alias, IAssemblySymbol targetAssembly)
        {
            Debug.Assert(alias != null);
            Debug.Assert(targetAssembly != null);

            Alias = alias;
            TargetAssembly = targetAssembly;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:ExternAliasRecord.cs

示例10: GetAssemblyAttributes

 public static IEnumerable<string> GetAssemblyAttributes(IAssemblySymbol assemblySymbol)
 {
     var attributes = assemblySymbol.GetAttributes();
     foreach (var attribute in attributes)
     {
         yield return attribute.ToString();
     }
 }
开发者ID:rgmills,项目名称:SourceBrowser,代码行数:8,代码来源:MetadataReading.cs

示例11: AssemblyHasPublicTypes

 private static bool AssemblyHasPublicTypes(IAssemblySymbol assembly)
 {
     return assembly
             .GlobalNamespace
             .GetMembers()
             .OfType<INamedTypeSymbol>()
             .Where(s => s.DeclaredAccessibility == Accessibility.Public)
             .Any();
 }
开发者ID:bkoelman,项目名称:roslyn-analyzers,代码行数:9,代码来源:MarkAssembliesWithComVisible.cs

示例12: IsOrUsesAssemblyType

        private static bool IsOrUsesAssemblyType(ITypeSymbol typeSymbol, IAssemblySymbol assemblySymbol)
        {
            if (typeSymbol.ContainingAssembly == assemblySymbol)
            {
                return true;
            }

            INamedTypeSymbol namedTypeSymbol = typeSymbol as INamedTypeSymbol;
            return namedTypeSymbol != null && namedTypeSymbol.IsGenericType
                && namedTypeSymbol.TypeArguments.Any(t => IsOrUsesAssemblyType(t, assemblySymbol));
        }
开发者ID:Azure,项目名称:azure-webjobs-sdk-script,代码行数:11,代码来源:CSharpCompilation.cs

示例13: MetadataSearchScope

 public MetadataSearchScope(
     Solution solution,
     IAssemblySymbol assembly,
     PortableExecutableReference metadataReference,
     bool ignoreCase,
     CancellationToken cancellationToken)
     : base(ignoreCase, cancellationToken)
 {
     _solution = solution;
     _assembly = assembly;
     _metadataReference = metadataReference;
 }
开发者ID:neooleg,项目名称:roslyn,代码行数:12,代码来源:AbstractAddImportCodeFixProvider.SearchScope.cs

示例14: IsObjectMapperFrameworkAssembly

 public static bool IsObjectMapperFrameworkAssembly(IAssemblySymbol assemblySymbol)
 {
     if (assemblySymbol.Name != "ObjectMapper.Framework")
     {
         return false;
     }
     if (!assemblySymbol.Identity.IsStrongName || !_publicKeyToken.SequenceEqual(assemblySymbol.Identity.PublicKeyToken))
     {
         return false;
     }
     return true;
 }
开发者ID:nejcskofic,项目名称:ObjectMapper,代码行数:12,代码来源:FrameworkHelpers.cs

示例15: ImportRecord

 public ImportRecord(
     ImportTargetKind targetKind,
     string alias = null,
     ITypeSymbol targetType = null,
     string targetString = null,
     IAssemblySymbol targetAssembly = null,
     string targetAssemblyAlias = null)
 {
     TargetKind = targetKind;
     Alias = alias;
     TargetType = targetType;
     TargetString = targetString;
     TargetAssembly = targetAssembly;
     TargetAssemblyAlias = targetAssemblyAlias;
 }
开发者ID:binsys,项目名称:roslyn,代码行数:15,代码来源:ImportRecord.cs


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