MetadataBuilder.AddLocalScope Method    
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds local scope debug information.
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
	Parameters
- method
 - MethodDefinitionHandle
 
The containing method.
- importScope
 - ImportScopeHandle
 
The handle of the associated import scope.
- variableList
 - LocalVariableHandle
 
If the scope declares variables, set this to the handle of the first one. Otherwise, set this to the handle of the first variable declared by the next scope definition. If no scope defines any variables, System.Reflection.Metadata.Ecma335.MetadataTokens.LocalVariableHandle(1).
- constantList
 - LocalConstantHandle
 
If the scope declares constants, set this the handle of the first one. Otherwise, set this to the handle of the first constant declared by the next scope definition. If no scope defines any constants, System.Reflection.Metadata.Ecma335.MetadataTokens.LocalConstantHandle(1).
- startOffset
 - Int32
 
The offset of the first instruction covered by the scope.
- length
 - Int32
 
The length (in bytes) of the scope.
Returns
A handle to the added local scope.
Remarks
Local scopes should be added in the same order as the corresponding method definition.
Within a method, they should be ordered by ascending startOffset and then by descending length.