PostSharp SDK 6.10 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Instruction­Sequence Class / Instruction­Sequence Methods / Instruction­Sequence.​Detach Method

InstructionSequence.Detach Method

Detaches the current InstructionSequence from its parent InstructionBlock.

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.10.14.0 (6.10.14.0)
Syntax
C#
public void Detach()
Exceptions
ExceptionCondition
InvalidOperationExceptionThe instruction sequence is not attached.
Remarks
This method does not detaches the InstructionSequence to the MethodBodyDeclaration to which it belongs. Note that the state of the instruction stream may be inconsistent after calling this method, because instructions may still reference the current InstructionSequence as a branch target. In order to redirect branch targets, call the Remove(InstructionSequence) or Redirect(InstructionSequence) method.
See Also