SyntaxFactory.LiteralExpression(SyntaxKind, SyntaxToken) Metodo

Definizione

Rappresenta un valore letterale. Il tipo di valore letterale è determinato dalla proprietà Kind: IntegerLiteral, CharacterLiteral, BooleanLiteral, DecimalLiteral, FloatingLiteral, DateLiteral o StringLiteral. Il valore del valore letterale può essere determinato eseguendo il cast del token associato al tipo corretto e recuperando il valore dal token.

public:
 static Microsoft::CodeAnalysis::VisualBasic::Syntax::LiteralExpressionSyntax ^ LiteralExpression(Microsoft::CodeAnalysis::VisualBasic::SyntaxKind kind, Microsoft::CodeAnalysis::SyntaxToken token);
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.LiteralExpressionSyntax LiteralExpression (Microsoft.CodeAnalysis.VisualBasic.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxToken token);
static member LiteralExpression : Microsoft.CodeAnalysis.VisualBasic.SyntaxKind * Microsoft.CodeAnalysis.SyntaxToken -> Microsoft.CodeAnalysis.VisualBasic.Syntax.LiteralExpressionSyntax
Public Shared Function LiteralExpression (kind As SyntaxKind, token As SyntaxToken) As LiteralExpressionSyntax

Parametri

kind
SyntaxKind

Oggetto SyntaxKind che rappresenta il tipo specifico di LiteralExpressionSyntax. Uno di CharacterLiteralExpression, TrueLiteralExpression, FalseLiteralExpression, NumericLiteralExpression, DateLiteralExpression, StringLiteralExpression, NothingLiteralExpression.

token
SyntaxToken

Token che rappresenta il valore letterale. La proprietà Kind determina il tipo restituito da questa proprietà: Kind=IntegerLiteral ==> Restituisce IntegerLiteralToken. Kind=CharacterLiteral ==> Restituisce CharacterLiteralToken. Kind=DecimalLiteral => = Restituisce DecimalLiteralToken Kind=FloatingLiteral => = Restituisce floatingLiteralToken Kind=DateLiteral> == Restituisce DateLiteralToken Kind=StringLiteralToken> Kind=Restituisce StringLiteralToken Kind=BooleanLiteral ==> Restituisce parola chiave (con il tipo trueKeyword o FalseKeyword) Kind=NothingLiteral> == Restituisce parola chiave (con il tipo NothingKeyword)

Restituisce

Si applica a