次の方法で共有


LocalBuilder.LocalType プロパティ

定義

ローカル変数の型を取得します。

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

プロパティ値

ローカル変数の Type

次のコード サンプルは、 の LocalType使用方法を示しています。 このコードは、 クラスの大きな例の LocalBuilder 一部です。

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

適用対象