LocalBuilder.LocalType Property

Gets the type of the local variable.

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

public override Type LocalType { get; }

Property Value

Type: System.Type
The Type of the local variable.

The following code sample illustrates the use of LocalType. This code is part of a larger example for the LocalBuilder class.


// Create local variables named myString and myInt.
LocalBuilder myLB1 = myMethodIL.DeclareLocal(typeof(string));
outputBlock.Text += String.Format("local 'myString' type is: {0}\n", myLB1.LocalType);

LocalBuilder myLB2 = myMethodIL.DeclareLocal(typeof(int));
outputBlock.Text += String.Format("local 'myInt' type is: {0}\n", myLB2.LocalType);


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: