LocalBuilder.SetLocalSymInfo 메서드

정의

지역 변수의 기호 정보를 설정합니다.

오버로드

SetLocalSymInfo(String)

이 지역 변수의 이름을 설정합니다.

SetLocalSymInfo(String, Int32, Int32)

이 지역 변수의 이름 및 어휘 범위를 설정합니다.

SetLocalSymInfo(String)

이 지역 변수의 이름을 설정합니다.

public:
 void SetLocalSymInfo(System::String ^ name);
public void SetLocalSymInfo (string name);
member this.SetLocalSymInfo : string -> unit
Public Sub SetLocalSymInfo (name As String)

매개 변수

name
String

지역 변수의 이름입니다.

예외

포함하는 형식을 CreateType()을 사용하여 만든 경우

또는

포함하는 모듈에 정의된 기호 작성기가 없는 경우

이 지역 변수가 동적 형식의 메서드가 아니라 동적 메서드에 정의된 경우

예제

다음 코드 샘플에서는 메서드의 사용을 보여 줍니다 SetLocalSymInfo . 이 코드는 클래스에 대한 더 큰 예제의 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)

설명

메서드는 SetLocalSymInfo 동적 형식에 정의된 메서드에 대해 지원됩니다. 클래스를 사용하여 정의된 동적 메서드에는 DynamicMethod 지원되지 않습니다.

적용 대상

SetLocalSymInfo(String, Int32, Int32)

이 지역 변수의 이름 및 어휘 범위를 설정합니다.

public:
 void SetLocalSymInfo(System::String ^ name, int startOffset, int endOffset);
public void SetLocalSymInfo (string name, int startOffset, int endOffset);
member this.SetLocalSymInfo : string * int * int -> unit
Public Sub SetLocalSymInfo (name As String, startOffset As Integer, endOffset As Integer)

매개 변수

name
String

지역 변수의 이름입니다.

startOffset
Int32

지역 변수 어휘 범위의 시작 오프셋입니다.

endOffset
Int32

지역 변수 어휘 범위의 끝 오프셋입니다.

예외

포함하는 형식을 CreateType()을 사용하여 만든 경우

또는

포함하는 모듈에 정의된 기호 작성기가 없는 경우

이 지역 변수가 동적 형식의 메서드가 아니라 동적 메서드에 정의된 경우

예제

다음 코드 샘플에서는 메서드의 사용을 보여 줍니다 SetLocalSymInfo . 이 코드는 클래스에 대한 더 큰 예제의 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)

설명

메서드는 SetLocalSymInfo 동적 형식에 정의된 메서드에 대해 지원됩니다. 클래스를 사용하여 정의된 동적 메서드에는 DynamicMethod 지원되지 않습니다.

적용 대상