FlowBehavior Enumeration |
Enumerates the possible behaviors of the calling method after the calling method has returned.
Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 6.6.14.0 (6.6.14.0)
C#
public enum FlowBehavior
Member name | Value | Description | |
---|---|---|---|
Default | 0 | Default flow behavior for the current method. The default flow is Continue for all advices except for OnException(MethodExecutionArgs) where it is RethrowException. | |
Continue | 1 | Continue normal method execution. For OnException(MethodExecutionArgs) advice, the Continue behavior works the same way as Return behavior. | |
RethrowException | 2 | The current exception will be rethrown. Available only for OnException(MethodExecutionArgs). | |
Return | 3 | Return immediately from the current method. Available only for OnEntry(MethodExecutionArgs) and OnException(MethodExecutionArgs). Note that you may want to set the ReturnValue property, otherwise you may get a NullReferenceException. If there is another OnMethodBoundaryAspect aspect before the current OnMethodBoundaryAspect aspect on the current method, the Return behavior calls the OnSuccess(MethodExecutionArgs) and OnExit(MethodExecutionArgs) methods of the other aspect. | |
ThrowException | 4 | Throws the exception contained in the Exception property. Available only for OnException(MethodExecutionArgs). | |
Yield | 5 | Awaits for an awaiter. Available only for OnEntry(MethodExecutionArgs) and OnResume(MethodExecutionArgs) advices applied to async methods. |
This enumeration is used by the MethodExecutionArgs class.