Reads a stream of binary IL instructions and debugging sequence points.

Namespace:  PostSharp.CodeModel
Assembly:  PostSharp.Core (in PostSharp.Core.dll)

Syntax

Visual Basic (Declaration)
Public NotInheritable Class InstructionReader _
	Implements IDisposable
C#
public sealed class InstructionReader : IDisposable
Visual C++
public ref class InstructionReader sealed : IDisposable

Remarks

Each InstructionReader instance is assigned to a single method. Developers must use the CreateInstructionReader()()() method to get an InstructionReader instance.

When you want to read an instruction block, you first need to enter it using the EnterInstructionBlock(InstructionBlock) method. The EnterInstructionBlock(InstructionBlock) method expect that the active block of the InstructionReader is the parent of the block you want to enter, so you have to enter all ascendant blocks, from the root to the leave, like in a stack model. Then you attach the reader to a sequence using EnterInstructionSequence(InstructionSequence). To read another sequence, you need first to use LeaveInstructionSequence()()(), then again EnterInstructionSequence(InstructionSequence). Use LeaveInstructionBlock()()() to leave a block.

If you want to enter a specific block without entering all its ancestors, use the JumpToInstructionBlock(InstructionBlock) method, which will make the proper calls to LeaveInstructionBlock()()() and EnterInstructionBlock(InstructionBlock) automatically.

When the InstructionReader has entered an InstructionSequence, you can use it as a classic reader. The ReadInstruction()()() reads the next instruction and you can read it on the instance properties of the InstructionReader.

Inheritance Hierarchy

System..::.Object
  PostSharp.CodeModel..::.InstructionReader

See Also