LocalBuilder.SetLocalSymInfo 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지역 변수의 기호 정보를 설정합니다.
오버로드
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
지역 변수의 이름입니다.
예외
이 지역 변수가 동적 형식의 메서드가 아니라 동적 메서드에 정의된 경우
예제
다음 코드 샘플에서는 메서드의 사용을 보여 줍니다 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
지역 변수 어휘 범위의 끝 오프셋입니다.
예외
이 지역 변수가 동적 형식의 메서드가 아니라 동적 메서드에 정의된 경우
예제
다음 코드 샘플에서는 메서드의 사용을 보여 줍니다 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 지원되지 않습니다.
적용 대상
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기