LocalType Property
Collapse the table of content
Expand the table of content

LocalBuilder.LocalType Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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);


Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2017 Microsoft