本文整理汇总了C#中ISyntaxFactsService.IsAttributeName方法的典型用法代码示例。如果您正苦于以下问题:C# ISyntaxFactsService.IsAttributeName方法的具体用法?C# ISyntaxFactsService.IsAttributeName怎么用?C# ISyntaxFactsService.IsAttributeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISyntaxFactsService
的用法示例。
在下文中一共展示了ISyntaxFactsService.IsAttributeName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateContext
private static void CalculateContext(SyntaxNode node, ISyntaxFactsService syntaxFacts, out string name, out int arity, out bool inAttributeContext, out bool hasIncompleteParentMember)
{
// Has to be a simple identifier or generic name.
syntaxFacts.GetNameAndArityOfSimpleName(node, out name, out arity);
inAttributeContext = syntaxFacts.IsAttributeName(node);
hasIncompleteParentMember = syntaxFacts.HasIncompleteParentMember(node);
}
示例2: GetDocumentationContent
private IDeferredQuickInfoContent GetDocumentationContent(
IEnumerable<ISymbol> symbols,
IDictionary<SymbolDescriptionGroups, ImmutableArray<TaggedText>> sections,
SemanticModel semanticModel,
SyntaxToken token,
IDocumentationCommentFormattingService formatter,
ISyntaxFactsService syntaxFactsService,
CancellationToken cancellationToken)
{
if (sections.ContainsKey(SymbolDescriptionGroups.Documentation))
{
var documentationBuilder = new List<TaggedText>();
documentationBuilder.AddRange(sections[SymbolDescriptionGroups.Documentation]);
return CreateClassifiableDeferredContent(documentationBuilder);
}
else if (symbols.Any())
{
var symbol = symbols.First().OriginalDefinition;
// if generating quick info for an attribute, bind to the class instead of the constructor
if (syntaxFactsService.IsAttributeName(token.Parent) &&
symbol.ContainingType?.IsAttribute() == true)
{
symbol = symbol.ContainingType;
}
var documentation = symbol.GetDocumentationParts(semanticModel, token.SpanStart, formatter, cancellationToken);
if (documentation != null)
{
return CreateClassifiableDeferredContent(documentation.ToList());
}
}
return CreateDocumentationCommentDeferredContent(null);
}