Share via


OperationExtensions.GetCorrespondingOperation(IBranchOperation) Method

Definition

Gets either a loop or a switch operation that corresponds to the given branch operation.

public static Microsoft.CodeAnalysis.IOperation GetCorrespondingOperation (this Microsoft.CodeAnalysis.Operations.IBranchOperation operation);
public static Microsoft.CodeAnalysis.IOperation? GetCorrespondingOperation (this Microsoft.CodeAnalysis.Operations.IBranchOperation operation);
static member GetCorrespondingOperation : Microsoft.CodeAnalysis.Operations.IBranchOperation -> Microsoft.CodeAnalysis.IOperation
<Extension()>
Public Function GetCorrespondingOperation (operation As IBranchOperation) As IOperation

Parameters

operation
IBranchOperation

The branch operation for which a corresponding operation is looked up

Returns

The corresponding operation or null in case not found (e.g. no loop or switch syntax, or the branch is not a break or continue)

Exceptions

operation is null

The operation is a part of Control Flow Graph

Applies to