MethodBody.LocalVariables Property

 

Gets the list of local variables declared in the method body.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

abstract LocalVariables : IList<LocalVariableInfo> with get
override LocalVariables : IList<LocalVariableInfo> with get

Property Value

Type: System.Collections.Generic.IList<LocalVariableInfo>

An IList<'T> of LocalVariableInfo objects that describe the local variables declared in the method body.

You do not need the metadata token for the local variable signature provided by the LocalSignatureMetadataToken property.

The following code example defines a test method named MethodBodyExample and displays its local variable information. The MethodBase.GetMethodBody method is used to obtain a MethodBody object for the test method. The LocalVariables property is used to obtain a list of LocalVariableInfo objects.

This code example is part of a larger example provided for the MethodBody class.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: