Läs på engelska

Dela via


CSharpExtensions Class

Definition

C#
public static class CSharpExtensions
Inheritance
CSharpExtensions

Methods

Any(SyntaxTokenList, SyntaxKind)

Tests whether a list contains a token of a particular kind.

Any(SyntaxTriviaList, SyntaxKind)

True if the list has at least one trivia of the specified kind.

Any<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)

True if the list has at least one node of the specified kind.

Any<TNode>(SyntaxList<TNode>, SyntaxKind)

True if the list has at least one node of the specified kind.

ContainsDirective(SyntaxNode, SyntaxKind)

Returns true if this node contains any directives (e.g. #if, #nullable, etc.) within it with a matching kind.

IndexOf(SyntaxTokenList, SyntaxKind)

Returns the index of the first token of a specified kind in the token list.

IndexOf(SyntaxTriviaList, SyntaxKind)

Returns the index of the first trivia of a specified kind in the trivia list.

IndexOf<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)

Returns the index of the first node of a specified kind in the node list.

IndexOf<TNode>(SyntaxList<TNode>, SyntaxKind)

Returns the index of the first node of a specified kind in the node list.

IsKind(SyntaxNode, SyntaxKind)

Determines if SyntaxNode is of a specified kind.

IsKind(SyntaxNodeOrToken, SyntaxKind)

Determines if SyntaxNodeOrToken is of a specified kind.

IsKind(SyntaxToken, SyntaxKind)

Determines if SyntaxToken is of a specified kind.

IsKind(SyntaxTrivia, SyntaxKind)

Determines if SyntaxTrivia is of a specified kind.

Applies to

Produkt Versioner
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0