PostSharp 4.3 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects Namespace / On­Method­Boundary­Aspect Class / On­Method­Boundary­Aspect Properties / On­Method­Boundary­Aspect.​Apply­To­State­Machine Property
OnMethodBoundaryAspect.ApplyToStateMachine Property
Determines how the aspect should behave when it is applied to an iterator or async methods, which are compiled into state machines.

Namespace: PostSharp.Aspects
Assembly: PostSharp (in PostSharp.dll) Version: 4.3.48.0 (4.3.48.0)
Syntax
C#
public bool ApplyToStateMachine { get; set; }

Property Value

Type: Boolean
true if the aspect should be applied to the state machine, or false if it should be applied to the method instantiating the state machine.
Remarks

The default value is false unless the aspect class implements the OnYield(MethodExecutionArgs) or OnResume(MethodExecutionArgs) advices. In the latter case the default value is true.

Assigning this property to true results in an aspect that is consistent with the level of abstraction of the programming language. The false value is consistent with the level of abstraction of MSIL and is backward-compatible with versions of PostSharp prior to 3.1.

See Also