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


C# ISymbol.GetGlyph方法代码示例

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


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

示例1: CreateItem

        public async Task<ICallHierarchyMemberItem> CreateItem(ISymbol symbol,
            Project project, IEnumerable<Location> callsites, CancellationToken cancellationToken)
        {
            if (symbol.Kind == SymbolKind.Method ||
                symbol.Kind == SymbolKind.Property ||
                symbol.Kind == SymbolKind.Event ||
                symbol.Kind == SymbolKind.Field)
            {
                symbol = GetTargetSymbol(symbol);

                var finders = await CreateFinders(symbol, project, cancellationToken).ConfigureAwait(false);

                ICallHierarchyMemberItem item = new CallHierarchyItem(symbol,
                    project.Id,
                    finders,
                    () => symbol.GetGlyph().GetImageSource(GlyphService),
                    this,
                    callsites,
                    project.Solution.Workspace);

                return item;
            }

            return null;
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:25,代码来源:CallHierarchyProvider.cs

示例2: GetThirdPartyDefinitionItem

        public override DefinitionItem GetThirdPartyDefinitionItem(
            Solution solution, ISymbol definition)
        {
            var symbolNavigationService = solution.Workspace.Services.GetService<ISymbolNavigationService>();
            if (!symbolNavigationService.WouldNavigateToSymbol(definition, solution, out var filePath, out var lineNumber, out var charOffset))
            {
                return null;
            }

            var displayParts = GetDisplayParts(filePath, lineNumber, charOffset);
            return new ExternalDefinitionItem(
                GlyphTags.GetTags(definition.GetGlyph()),
                displayParts, _serviceProvider, filePath, lineNumber, charOffset);
        }
开发者ID:panopticoncentral,项目名称:roslyn,代码行数:14,代码来源:VisualStudioDefinitionsAndReferencesFactory.cs

示例3: CreateGlyphDeferredContent

 protected IDeferredQuickInfoContent CreateGlyphDeferredContent(ISymbol symbol)
 {
     return new SymbolGlyphDeferredContent(symbol.GetGlyph(), _glyphService);
 }
开发者ID:RoryVL,项目名称:roslyn,代码行数:4,代码来源:AbstractQuickInfoProvider.cs

示例4: CreateItemForMember

        private NavigationBarItem CreateItemForMember(ISymbol member, int symbolIndex, SyntaxTree tree, CancellationToken cancellationToken)
        {
            var spans = GetSpansInDocument(member, tree, cancellationToken);

            return new NavigationBarSymbolItem(
                member.ToDisplayString(s_memberFormat),
                member.GetGlyph(),
                spans,
                member.GetSymbolKey(),
                symbolIndex,
                grayed: spans.Count == 0);
        }
开发者ID:vslsnap,项目名称:roslyn,代码行数:12,代码来源:CSharpNavigationBarItemService.cs

示例5: CreateItem

            private CompletionItem CreateItem(
                ISymbol symbol, TextSpan textChangeSpan, ISymbolDisplayService symbolDisplayService,
                SemanticModel semanticModel, SyntaxToken startToken, DeclarationModifiers modifiers)
            {
                var position = startToken.SpanStart;

                var displayString = symbolDisplayService.ToMinimalDisplayString(semanticModel, position, symbol, _overrideNameFormat);

                return  MemberInsertionCompletionItem.Create(
                    displayString,
                    textChangeSpan,
                    symbol.GetGlyph(),
                    modifiers,
                    _startLineNumber,
                    symbol,
                    startToken,
                    position,
                    rules: _provider.GetRules());
            }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:19,代码来源:AbstractOverrideCompletionProvider.ItemGetter.cs

示例6: CreateItem

        private CompletionItem CreateItem(
            Workspace workspace, SemanticModel semanticModel, ISymbol symbol, SyntaxToken token, TextSpan filterSpan, StringBuilder builder)
        {
            int position = token.SpanStart;

            if (symbol is INamespaceOrTypeSymbol && token.IsKind(SyntaxKind.DotToken))
            {
                // Handle qualified namespace and type names.

                builder.Append(symbol.ToDisplayString(QualifiedCrefFormat));
            }
            else
            {
                // Handle unqualified namespace and type names, or member names.

                builder.Append(symbol.ToMinimalDisplayString(semanticModel, position, CrefFormat));

                var parameters = symbol.GetParameters();
                if (!parameters.IsDefaultOrEmpty)
                {
                    // Note: we intentionally don't add the "params" modifier for any parameters.

                    builder.Append(symbol.IsIndexer() ? '[' : '(');

                    for (int i = 0; i < parameters.Length; i++)
                    {
                        if (i > 0)
                        {
                            builder.Append(", ");
                        }

                        var parameter = parameters[i];

                        if (parameter.RefKind == RefKind.Out)
                        {
                            builder.Append("out ");
                        }
                        else if (parameter.RefKind == RefKind.Ref)
                        {
                            builder.Append("ref ");
                        }

                        builder.Append(parameter.Type.ToMinimalDisplayString(semanticModel, position));
                    }

                    builder.Append(symbol.IsIndexer() ? ']' : ')');
                }
            }

            var symbolText = builder.ToString();

            var insertionText = builder
                .Replace('<', '{')
                .Replace('>', '}')
                .ToString();

            return new Item(
                completionProvider: this,
                displayText: insertionText,
                insertionText: insertionText,
                textSpan: filterSpan,
                descriptionFactory: CommonCompletionUtilities.CreateDescriptionFactory(workspace, semanticModel, position, symbol),
                glyph: symbol.GetGlyph(),
                sortText: symbolText);
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:65,代码来源:CrefCompletionProvider.cs

示例7: CreateGlyphDeferredContent

 protected Glyph CreateGlyphDeferredContent(ISymbol symbol)
 {
     return symbol.GetGlyph().ToOurGlyph();
 }
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:4,代码来源:AbstractQuickInfoProvider.cs

示例8: CreateItem

            private MemberInsertionCompletionItem CreateItem(
                ISymbol symbol, TextSpan textChangeSpan, ISymbolDisplayService symbolDisplayService,
                SemanticModel semanticModel, SyntaxToken startToken, DeclarationModifiers modifiers)
            {
                var position = startToken.SpanStart;

                var displayString = symbolDisplayService.ToMinimalDisplayString(semanticModel, position, symbol, _overrideNameFormat);

                return new MemberInsertionCompletionItem(_provider,
                    displayString,
                    textChangeSpan,
                    CommonCompletionUtilities.CreateDescriptionFactory(_document.Project.Solution.Workspace, semanticModel, position, symbol),
                    symbol.GetGlyph(),
                    modifiers,
                    _startLineNumber,
                    symbol.GetSymbolKey(),
                    startToken);
            }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:18,代码来源:AbstractOverrideCompletionProvider.ItemGetter.cs

示例9: CreateItemAsync

        private async Task<CompletionItem> CreateItemAsync(
            Workspace workspace, SemanticModel semanticModel, int textChangeSpanPosition, ISymbol symbol, SyntaxToken token, CancellationToken cancellationToken)
        {
            int tokenPosition = token.SpanStart;
            string symbolText = string.Empty;

            if (symbol is INamespaceOrTypeSymbol && token.IsKind(SyntaxKind.DotToken))
            {
                symbolText = symbol.Name.EscapeIdentifier();

                if (symbol.GetArity() > 0)
                {
                    symbolText += "{";
                    symbolText += string.Join(", ", ((INamedTypeSymbol)symbol).TypeParameters);
                    symbolText += "}";
                }
            }
            else
            {
                symbolText = symbol.ToMinimalDisplayString(semanticModel, tokenPosition, CrefFormat);
                var parameters = symbol.GetParameters().Select(p =>
                    {
                        var displayName = p.Type.ToMinimalDisplayString(semanticModel, tokenPosition);

                        if (p.RefKind == RefKind.Out)
                        {
                            return "out " + displayName;
                        }

                        if (p.RefKind == RefKind.Ref)
                        {
                            return "ref " + displayName;
                        }

                        return displayName;
                    });

                var parameterList = !symbol.IsIndexer() ? string.Format("({0})", string.Join(", ", parameters))
                                                        : string.Format("[{0}]", string.Join(", ", parameters));
                symbolText += parameterList;
            }

            var insertionText = symbolText
                .Replace('<', '{')
                .Replace('>', '}')
                .Replace("()", "");

            var text = await semanticModel.SyntaxTree.GetTextAsync(cancellationToken).ConfigureAwait(false);
            return new CrefCompletionItem(
                workspace,
                completionProvider: this,
                displayText: insertionText,
                insertionText: insertionText,
                textSpan: GetTextChangeSpan(text, textChangeSpanPosition),
                descriptionFactory: CommonCompletionUtilities.CreateDescriptionFactory(workspace, semanticModel, tokenPosition, symbol),
                glyph: symbol.GetGlyph(),
                sortText: symbolText);
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:58,代码来源:CrefCompletionProvider.cs


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