Skip to main content

CSharpFactory.VariableDeclaration Method

Containing Type: CSharpFactory

Assembly: Roslynator.CSharp.dll

Overloads

MethodSummary
VariableDeclaration(TypeSyntax, String, ExpressionSyntax)
VariableDeclaration(TypeSyntax, SyntaxToken, EqualsValueClauseSyntax)
VariableDeclaration(TypeSyntax, SyntaxToken, ExpressionSyntax)
VariableDeclaration(TypeSyntax, VariableDeclaratorSyntax)

VariableDeclaration(TypeSyntax, String, ExpressionSyntax)

public static Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax VariableDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, string identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax? value = null)

Parameters

type TypeSyntax

identifier String

value ExpressionSyntax

Returns

VariableDeclarationSyntax

VariableDeclaration(TypeSyntax, SyntaxToken, EqualsValueClauseSyntax)

public static Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax VariableDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.EqualsValueClauseSyntax? initializer)

Parameters

type TypeSyntax

identifier SyntaxToken

initializer EqualsValueClauseSyntax

Returns

VariableDeclarationSyntax

VariableDeclaration(TypeSyntax, SyntaxToken, ExpressionSyntax)

public static Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax VariableDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax? value = null)

Parameters

type TypeSyntax

identifier SyntaxToken

value ExpressionSyntax

Returns

VariableDeclarationSyntax

VariableDeclaration(TypeSyntax, VariableDeclaratorSyntax)

public static Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclarationSyntax VariableDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.TypeSyntax type, Microsoft.CodeAnalysis.CSharp.Syntax.VariableDeclaratorSyntax variable)

Parameters

type TypeSyntax

variable VariableDeclaratorSyntax

Returns

VariableDeclarationSyntax