System.Diagnostics.SymbolStore.ISymbolWriter.OpenScope Method

Opens a new lexical scope in the current method.

Syntax

public int OpenScope (int startOffset)

Parameters

startOffset
The offset, in bytes, from the beginning of the method to the first instruction in the lexical scope.

Returns

An opaque scope identifier that can be used with ISymbolWriter.SetScopeRange(int, int, int) to define the start and end offsets of a scope at a later time. In this case, the offsets passed to ISymbolWriter.OpenScope(int) and ISymbolWriter.CloseScope(int) are ignored. A scope identifier is valid only in the current method.

Remarks

This scope becomes the new current scope and is pushed onto a stack of scopes. Scopes must form a hierarchy. Siblings are not allowed to overlap.

Scope identifiers are valid only in the current method.

Requirements

Namespace: System.Diagnostics.SymbolStore
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0