Show / Hide Table of Contents

Struct LocalVariable

Represents local variable declaration in the method body

Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: CilTools.Reflection
Assembly: CilTools.BytecodeAnalysis.dll
Syntax
public struct LocalVariable

Properties

IsPinned

Gets the value indicating whether the object pointed by local variable is pinned in memory

Declaration
public bool IsPinned { get; }
Property Value
Type Description
System.Boolean

LocalIndex

Gets the index of local variable within the containing method body

Declaration
public int LocalIndex { get; }
Property Value
Type Description
System.Int32

LocalType

Gets the variable type

Declaration
public Type LocalType { get; }
Property Value
Type Description
System.Type

LocalTypeSpec

Gets the TypeSpec object representing the variable type

Declaration
public TypeSpec LocalTypeSpec { get; }
Property Value
Type Description
TypeSpec

Method

Gets the method in which this local variable is declared

Declaration
public MethodBase Method { get; }
Property Value
Type Description
System.Reflection.MethodBase

Methods

ReadMethodSignature(MethodBase, Byte[], SignatureContext)

Reads local variables from the specified method signature

Declaration
public static LocalVariable[] ReadMethodSignature(MethodBase m, byte[] data, SignatureContext ctx)
Parameters
Type Name Description
System.Reflection.MethodBase m

Method which local variables are read

System.Byte[] data

Local variable signature as byte array

SignatureContext ctx

Signature context information

Returns
Type Description
LocalVariable[]

An array of local variables read from the signature

Exceptions
Type Condition
System.ArgumentNullException

Method, input array or signature context is null

System.NotSupportedException

Signature contains unsupported types

ReadSignature(Byte[], ITokenResolver)

Reads local variables from the specified signature, resolving tokens using the specified ITokenResolver

Declaration
public static LocalVariable[] ReadSignature(byte[] data, ITokenResolver resolver)
Parameters
Type Name Description
System.Byte[] data

Local variable signature as byte array

ITokenResolver resolver

The object used to resolve metadata tokens

Returns
Type Description
LocalVariable[]

An array of local variables read from the signature

Exceptions
Type Condition
System.ArgumentNullException

Input array is null

System.NotSupportedException

Signature contains unsupported types

ReadSignature(Byte[], ITokenResolver, MemberInfo)

Reads local variables from the specified signature, resolving tokens using the specified ITokenResolver in a generic context identified by the specified member reference.

Declaration
public static LocalVariable[] ReadSignature(byte[] data, ITokenResolver resolver, MemberInfo member)
Parameters
Type Name Description
System.Byte[] data

Local variable signature as byte array

ITokenResolver resolver

The object used to resolve metadata tokens

System.Reflection.MemberInfo member

Method that identifies generic context for generic method params, or null if this signature does not belong to a generic method

Returns
Type Description
LocalVariable[]

An array of local variables read from the signature

Exceptions
Type Condition
System.ArgumentNullException

Input array is null

System.NotSupportedException

Signature contains unsupported types

ReadSignature(Byte[], Module)

Reads local variables from the specified signature, resolving tokens within the scope of the specified module

Declaration
public static LocalVariable[] ReadSignature(byte[] data, Module module)
Parameters
Type Name Description
System.Byte[] data

Local variable signature as byte array

System.Reflection.Module module

Module in which to resolve metadata tokens

Returns
Type Description
LocalVariable[]

An array of local variables read from the signature

Exceptions
Type Condition
System.ArgumentNullException

Input array is null

System.NotSupportedException

Signature contains unsupported types

Back to top CIL Tools (published from sources in GitHub repository).
Generated by DocFX