System.Diagnostics.SymbolStore.ISymbolMethod Interface

Assembly: Mscorlib.dll
Namespace: System.Diagnostics.SymbolStore
Summary
Represents a method within a symbol reader.
C# Syntax:
public interface ISymbolMethod
Remarks
This provides access only to the symbol-related attributes of a method, such as sequence points, lexical scopes, and parameter information. Use the ISymbolMethod interface to read the type-related attributes of a method (such as the System.Reflection classes).
See also:
System.Diagnostics.SymbolStore Namespace See also:
MSDN: emittingsymbolicinformationwithreflectionemit

System.Diagnostics.SymbolStore.ISymbolMethod Member List:

Public Properties
RootScope Read-only

Gets the root lexical scope for the current method. This scope encloses the entire method.
SequencePointCount Read-only

Gets a count of the sequence points in the method.
Token Read-only

Gets the SymbolToken containing the metadata for the current method.
Public Methods
GetNamespace Gets the namespace that the current method is defined within.
GetOffset Gets the Microsoft intermediate language (MSIL) offset within the method that corresponds to the specified position.
GetParameters Gets the parameters for the current method.
GetRanges Gets an array of start and end offset pairs that correspond to the ranges of Microsoft intermediate language (MSIL) that a given position covers within this method.
GetScope Returns the most enclosing lexical scope when given an offset within a method.
GetSequencePoints Gets the sequence points for the current method.
GetSourceStartEnd Gets the start and end positions for the source of the current method.

System.Diagnostics.SymbolStore.ISymbolMethod Member Details

Property: RootScope (read-only)
Summary
Gets the root lexical scope for the current method. This scope encloses the entire method.
C# Syntax:
ISymbolScope RootScope {get;}
See also:
MSDN: emittingsymbolicinformationwithreflectionemit

Return to top


Property: SequencePointCount (read-only)
Summary
Gets a count of the sequence points in the method.
C# Syntax:
int SequencePointCount {get;}

Return to top


Property: Token (read-only)
Summary
Gets the SymbolToken containing the metadata for the current method.
C# Syntax:
SymbolToken Token {get;}
See also:
SymbolToken

Return to top


Method: GetNamespace()
Summary
Gets the namespace that the current method is defined within.
C# Syntax:
ISymbolNamespace GetNamespace();
Return Value:
The namespace that the current method is defined within.

Return to top


Method: GetOffset(
   ISymbolDocument document,
   int line,
   int column
)
Summary
Gets the Microsoft intermediate language (MSIL) offset within the method that corresponds to the specified position.
C# Syntax:
int GetOffset(
   ISymbolDocument document,
   int line,
   int column
);
Parameters:

document

The document for which the offset is requested.

line

The document line corresponding to the offset.

column

The document column corresponding to the offset.

Return Value:
The offset within the specified document.
Remarks
The parameters are returned in the order that they are defined within the signature of the method.

Return to top


Method: GetParameters()
Summary
Gets the parameters for the current method.
C# Syntax:
ISymbolVariable[] GetParameters();
Return Value:
The array of parameters for the current method.
Remarks
The parameters are returned in the order that they are defined within the signature of the method.

Return to top


Method: GetRanges(
   ISymbolDocument document,
   int line,
   int column
)
Summary
Gets an array of start and end offset pairs that correspond to the ranges of Microsoft intermediate language (MSIL) that a given position covers within this method.
C# Syntax:
int[] GetRanges(
   ISymbolDocument document,
   int line,
   int column
);
Parameters:

document

The document for which the offset is requested.

line

The document line corresponding to the ranges.

column

The document column corresponding to the ranges.

Return Value:
An array of start and end offset pairs.
Remarks
The array is an array of integers in the format {{start1, end1}, {start2, end2}...}. The number of range pairs is the length of the array divided by 2.

Return to top


Method: GetScope(
   int offset
)
Summary
Returns the most enclosing lexical scope when given an offset within a method.
C# Syntax:
ISymbolScope GetScope(
   int offset
);
Parameters:

offset

The byte offset within the method of the lexical scope.

Return Value:
The most enclosing lexical scope for the given byte offset within the method.
Remarks
You can use the ISymbolMethod.GetScope method to start local variable searches.
See also:
MSDN: emittingsymbolicinformationwithreflectionemit

Return to top


Method: GetSequencePoints(
   int[] offsets,
   ISymbolDocument[] documents,
   int[] lines,
   int[] columns,
   int[] endLines,
   int[] endColumns
)
Summary
Gets the sequence points for the current method.
C# Syntax:
void GetSequencePoints(
   int[] offsets,
   ISymbolDocument[] documents,
   int[] lines,
   int[] columns,
   int[] endLines,
   int[] endColumns
);
Parameters:

offsets

The array of byte offsets from the beginning of the method for the sequence points.

documents

The array of documents in which the sequence points are located.

lines

The array of lines in the documents at which the sequence points are located.

columns

The array of columns in the documents at which the sequence points are located.

endLines

The array of lines in the documents at which the sequence points end.

endColumns

The array of columns in the documents at which the sequence points end.

Remarks
The sequence points are sorted by offset and are for all documents in the method. Use ISymbolMethod.SequencePointCount to retrieve the count of all sequence points and create arrays of the proper size.

ISymbolMethod.GetSequencePoints verifies the size of each array and places the sequence point information into each. If any array is null, the data for that array is not returned.

Return to top


Method: GetSourceStartEnd(
   ISymbolDocument[] docs,
   int[] lines,
   int[] columns
)
Summary
Gets the start and end positions for the source of the current method.
C# Syntax:
bool GetSourceStartEnd(
   ISymbolDocument[] docs,
   int[] lines,
   int[] columns
);
Parameters:

docs

The starting and ending source documents.

lines

The starting and ending lines in the corresponding source documents.

columns

The starting and ending columns in the corresponding source documents.

Return Value:
true if the positions were defined; otherwise, false.
Remarks
The first array position is the start, and the second is the end.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.