Freigeben über


LocalBuilder.LocalType Eigenschaft

Definition

Ruft den Typ der lokalen Variablen ab.

public:
 virtual property Type ^ LocalType { Type ^ get(); };
public:
 property Type ^ LocalType { Type ^ get(); };
public override Type LocalType { get; }
public Type LocalType { get; }
member this.LocalType : Type
Public Overrides ReadOnly Property LocalType As Type
Public ReadOnly Property LocalType As Type

Eigenschaftswert

Der Type der lokalen Variablen.

Beispiele

Im folgenden Codebeispiel wird die Verwendung von LocalTypeveranschaulicht. Dieser Code ist Teil eines größeren Beispiels für die LocalBuilder -Klasse.

// Create local variables named myString and myInt.
LocalBuilder^ myLB1 = myMethodIL->DeclareLocal( String::typeid );
myLB1->SetLocalSymInfo( "myString" );
Console::WriteLine( "local 'myString' type is: {0}", myLB1->LocalType );

LocalBuilder^ myLB2 = myMethodIL->DeclareLocal( int::typeid );
myLB2->SetLocalSymInfo( "myInt", 1, 2 );
Console::WriteLine( "local 'myInt' type is: {0}", myLB2->LocalType );
// Create local variables named myString and myInt.
LocalBuilder myLB1 = myMethodIL.DeclareLocal(typeof(string));
myLB1.SetLocalSymInfo("myString");
Console.WriteLine("local 'myString' type is: {0}", myLB1.LocalType);

LocalBuilder myLB2 = myMethodIL.DeclareLocal(typeof(int));
myLB2.SetLocalSymInfo("myInt", 1, 2);
Console.WriteLine("local 'myInt' type is: {0}", myLB2.LocalType);
' Create local variables named myString and myInt.
Dim myLB1 As LocalBuilder = myMethodIL.DeclareLocal(GetType(String))
myLB1.SetLocalSymInfo("myString")
Console.WriteLine("local 'myString' type is: {0}", myLB1.LocalType)

Dim myLB2 As LocalBuilder = myMethodIL.DeclareLocal(GetType(Integer))
myLB2.SetLocalSymInfo("myInt", 1, 2)
Console.WriteLine("local 'myInt' type is: {0}", myLB2.LocalType)

Gilt für: