Beispiel #1
0
 internal override BoundNode Bind(Binder binder, CSharpSyntaxNode node, DiagnosticBag diagnostics)
 {
     if (node.Kind() == SyntaxKind.Attribute)
     {
         var attribute = (AttributeSyntax)node;
         return(binder.BindAttribute(attribute, AttributeType, diagnostics));
     }
     else if (SyntaxFacts.IsAttributeName(node))
     {
         return(new BoundTypeExpression((NameSyntax)node, _aliasOpt, type: AttributeType));
     }
     else
     {
         return(base.Bind(binder, node, diagnostics));
     }
 }
 internal override BoundNode Bind(Binder binder, CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
 {
     if (node.Kind() == SyntaxKind.Attribute)
     {
         var attribute = (AttributeSyntax)node;
         // note: we should find the attributed member before binding the attribute as part of https://github.com/dotnet/roslyn/issues/53618
         return(binder.BindAttribute(attribute, AttributeType, attributedMember: null, diagnostics));
     }
     else if (SyntaxFacts.IsAttributeName(node))
     {
         return(new BoundTypeExpression((NameSyntax)node, _aliasOpt, type: AttributeType));
     }
     else
     {
         return(base.Bind(binder, node, diagnostics));
     }
 }
 public bool IsAttributeName(SyntaxNode node)
 {
     return(SyntaxFacts.IsAttributeName(node));
 }