MetadataBuilder.AddLocalScope 方法

定義

新增本機範圍偵錯資訊。

public:
 System::Reflection::Metadata::LocalScopeHandle AddLocalScope(System::Reflection::Metadata::MethodDefinitionHandle method, System::Reflection::Metadata::ImportScopeHandle importScope, System::Reflection::Metadata::LocalVariableHandle variableList, System::Reflection::Metadata::LocalConstantHandle constantList, int startOffset, int length);
public System.Reflection.Metadata.LocalScopeHandle AddLocalScope (System.Reflection.Metadata.MethodDefinitionHandle method, System.Reflection.Metadata.ImportScopeHandle importScope, System.Reflection.Metadata.LocalVariableHandle variableList, System.Reflection.Metadata.LocalConstantHandle constantList, int startOffset, int length);
member this.AddLocalScope : System.Reflection.Metadata.MethodDefinitionHandle * System.Reflection.Metadata.ImportScopeHandle * System.Reflection.Metadata.LocalVariableHandle * System.Reflection.Metadata.LocalConstantHandle * int * int -> System.Reflection.Metadata.LocalScopeHandle
Public Function AddLocalScope (method As MethodDefinitionHandle, importScope As ImportScopeHandle, variableList As LocalVariableHandle, constantList As LocalConstantHandle, startOffset As Integer, length As Integer) As LocalScopeHandle

參數

method
MethodDefinitionHandle

內含方法。

importScope
ImportScopeHandle

相關聯之匯入範圍的控制代碼。

variableList
LocalVariableHandle

如果範圍宣告變數,則請將此值設定為第一個變數的控制代碼。 否則,請將此值設定為下一個範圍定義所宣告第一個變數的控制代碼。 如果沒有範圍定義任何變數,則為 System.Reflection.Metadata.Ecma335.MetadataTokens.LocalVariableHandle(1)

constantList
LocalConstantHandle

如果範圍宣告常數,則請將此值設定為第一個常數的控制代碼。 否則,請將此值設定為下一個範圍定義所宣告第一個常數的控制代碼。 如果沒有範圍定義任何常數,則為 System.Reflection.Metadata.Ecma335.MetadataTokens.LocalConstantHandle(1)

startOffset
Int32

範圍所涵蓋第一個指令的位移。

length
Int32

範圍的長度 (以位元組為單位)。

傳回

已新增之本機範圍的控制代碼。

備註

本機範圍應該以與對應的方法定義相同的順序新增。

在方法內,它們應該依遞增 startOffset 排序,然後依遞減排序 length

適用於