Share via


SyntaxFactory.MethodStatement Method

Definition

Overloads

MethodStatement(SyntaxKind, SyntaxToken, SyntaxToken)

The statement that declares a Sub or Function. If this method has a body, this statement will be the Begin of a BlockStatement with Kind=MethodDeclarationBlock, and the body of the method will be the Body of that BlockStatement.

MethodStatement(SyntaxKind, SyntaxToken, String)

The statement that declares a Sub or Function. If this method has a body, this statement will be the Begin of a BlockStatement with Kind=MethodDeclarationBlock, and the body of the method will be the Body of that BlockStatement.

MethodStatement(SyntaxKind, SyntaxList<AttributeListSyntax>, SyntaxTokenList, SyntaxToken, SyntaxToken, TypeParameterListSyntax, ParameterListSyntax, SimpleAsClauseSyntax, HandlesClauseSyntax, ImplementsClauseSyntax)

The statement that declares a Sub or Function. If this method has a body, this statement will be the Begin of a BlockStatement with Kind=MethodDeclarationBlock, and the body of the method will be the Body of that BlockStatement.

MethodStatement(SyntaxKind, SyntaxToken, SyntaxToken)

Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb

The statement that declares a Sub or Function. If this method has a body, this statement will be the Begin of a BlockStatement with Kind=MethodDeclarationBlock, and the body of the method will be the Body of that BlockStatement.

public:
 static Microsoft::CodeAnalysis::VisualBasic::Syntax::MethodStatementSyntax ^ MethodStatement(Microsoft::CodeAnalysis::VisualBasic::SyntaxKind kind, Microsoft::CodeAnalysis::SyntaxToken subOrFunctionKeyword, Microsoft::CodeAnalysis::SyntaxToken identifier);
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodStatementSyntax MethodStatement (Microsoft.CodeAnalysis.VisualBasic.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxToken subOrFunctionKeyword, Microsoft.CodeAnalysis.SyntaxToken identifier);
static member MethodStatement : Microsoft.CodeAnalysis.VisualBasic.SyntaxKind * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.SyntaxToken -> Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodStatementSyntax
Public Shared Function MethodStatement (kind As SyntaxKind, subOrFunctionKeyword As SyntaxToken, identifier As SyntaxToken) As MethodStatementSyntax

Parameters

kind
SyntaxKind

A SyntaxKind representing the specific kind of MethodStatementSyntax. One of SubStatement, FunctionStatement.

subOrFunctionKeyword
SyntaxToken

The "Sub" or "Function" keyword that introduces this method declaration.

identifier
SyntaxToken

The name of the method being declared.

Returns

Applies to

MethodStatement(SyntaxKind, SyntaxToken, String)

Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb

The statement that declares a Sub or Function. If this method has a body, this statement will be the Begin of a BlockStatement with Kind=MethodDeclarationBlock, and the body of the method will be the Body of that BlockStatement.

public:
 static Microsoft::CodeAnalysis::VisualBasic::Syntax::MethodStatementSyntax ^ MethodStatement(Microsoft::CodeAnalysis::VisualBasic::SyntaxKind kind, Microsoft::CodeAnalysis::SyntaxToken subOrFunctionKeyword, System::String ^ identifier);
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodStatementSyntax MethodStatement (Microsoft.CodeAnalysis.VisualBasic.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxToken subOrFunctionKeyword, string identifier);
static member MethodStatement : Microsoft.CodeAnalysis.VisualBasic.SyntaxKind * Microsoft.CodeAnalysis.SyntaxToken * string -> Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodStatementSyntax
Public Shared Function MethodStatement (kind As SyntaxKind, subOrFunctionKeyword As SyntaxToken, identifier As String) As MethodStatementSyntax

Parameters

kind
SyntaxKind

A SyntaxKind representing the specific kind of MethodStatementSyntax. One of SubStatement, FunctionStatement.

subOrFunctionKeyword
SyntaxToken

The "Sub" or "Function" keyword that introduces this method declaration.

identifier
String

The name of the method being declared.

Returns

Applies to

MethodStatement(SyntaxKind, SyntaxList<AttributeListSyntax>, SyntaxTokenList, SyntaxToken, SyntaxToken, TypeParameterListSyntax, ParameterListSyntax, SimpleAsClauseSyntax, HandlesClauseSyntax, ImplementsClauseSyntax)

Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb
Source:
Syntax.xml.Main.Generated.vb

The statement that declares a Sub or Function. If this method has a body, this statement will be the Begin of a BlockStatement with Kind=MethodDeclarationBlock, and the body of the method will be the Body of that BlockStatement.

public:
 static Microsoft::CodeAnalysis::VisualBasic::Syntax::MethodStatementSyntax ^ MethodStatement(Microsoft::CodeAnalysis::VisualBasic::SyntaxKind kind, Microsoft::CodeAnalysis::SyntaxList<Microsoft::CodeAnalysis::VisualBasic::Syntax::AttributeListSyntax ^> attributeLists, Microsoft::CodeAnalysis::SyntaxTokenList modifiers, Microsoft::CodeAnalysis::SyntaxToken subOrFunctionKeyword, Microsoft::CodeAnalysis::SyntaxToken identifier, Microsoft::CodeAnalysis::VisualBasic::Syntax::TypeParameterListSyntax ^ typeParameterList, Microsoft::CodeAnalysis::VisualBasic::Syntax::ParameterListSyntax ^ parameterList, Microsoft::CodeAnalysis::VisualBasic::Syntax::SimpleAsClauseSyntax ^ asClause, Microsoft::CodeAnalysis::VisualBasic::Syntax::HandlesClauseSyntax ^ handlesClause, Microsoft::CodeAnalysis::VisualBasic::Syntax::ImplementsClauseSyntax ^ implementsClause);
public static Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodStatementSyntax MethodStatement (Microsoft.CodeAnalysis.VisualBasic.SyntaxKind kind, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeListSyntax> attributeLists, Microsoft.CodeAnalysis.SyntaxTokenList modifiers, Microsoft.CodeAnalysis.SyntaxToken subOrFunctionKeyword, Microsoft.CodeAnalysis.SyntaxToken identifier, Microsoft.CodeAnalysis.VisualBasic.Syntax.TypeParameterListSyntax typeParameterList, Microsoft.CodeAnalysis.VisualBasic.Syntax.ParameterListSyntax parameterList, Microsoft.CodeAnalysis.VisualBasic.Syntax.SimpleAsClauseSyntax asClause, Microsoft.CodeAnalysis.VisualBasic.Syntax.HandlesClauseSyntax handlesClause, Microsoft.CodeAnalysis.VisualBasic.Syntax.ImplementsClauseSyntax implementsClause);
static member MethodStatement : Microsoft.CodeAnalysis.VisualBasic.SyntaxKind * Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeListSyntax> * Microsoft.CodeAnalysis.SyntaxTokenList * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.VisualBasic.Syntax.TypeParameterListSyntax * Microsoft.CodeAnalysis.VisualBasic.Syntax.ParameterListSyntax * Microsoft.CodeAnalysis.VisualBasic.Syntax.SimpleAsClauseSyntax * Microsoft.CodeAnalysis.VisualBasic.Syntax.HandlesClauseSyntax * Microsoft.CodeAnalysis.VisualBasic.Syntax.ImplementsClauseSyntax -> Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodStatementSyntax
Public Shared Function MethodStatement (kind As SyntaxKind, attributeLists As SyntaxList(Of AttributeListSyntax), modifiers As SyntaxTokenList, subOrFunctionKeyword As SyntaxToken, identifier As SyntaxToken, typeParameterList As TypeParameterListSyntax, parameterList As ParameterListSyntax, asClause As SimpleAsClauseSyntax, handlesClause As HandlesClauseSyntax, implementsClause As ImplementsClauseSyntax) As MethodStatementSyntax

Parameters

kind
SyntaxKind

A SyntaxKind representing the specific kind of MethodStatementSyntax. One of SubStatement, FunctionStatement.

attributeLists
SyntaxList<AttributeListSyntax>

A list of all attribute lists on this declaration. If no attributes were specified, Nothing is returned.

modifiers
SyntaxTokenList

A list of all the modifier tokens that were present on this declaration. If no modifiers were specified, an empty list is returned. A bitfield version of all the modifiers ORed together, which is in many cases easier to use, can be obtained with the Modifiers property.

subOrFunctionKeyword
SyntaxToken

The "Sub" or "Function" keyword that introduces this method declaration.

identifier
SyntaxToken

The name of the method being declared.

typeParameterList
TypeParameterListSyntax

If present, a type parameter list with generic type parameters for this method. If no generic type parameters were present, Nothing is returned.

parameterList
ParameterListSyntax

The method's parameter list including the parentheses. If no parameter list was present, Nothing is returned.

asClause
SimpleAsClauseSyntax

The "As" clause that describes the return type. If no As clause was present, Nothing is returned.

handlesClause
HandlesClauseSyntax

If present, a Handles clause indicated the events that this method handles.

implementsClause
ImplementsClauseSyntax

If present, an Implements clause indicated the interface methods that this method implements.

Returns

Applies to