Determines whether the current advice requires to be woven on a given join point.
Namespace:
PostSharp.CodeWeaverAssembly: PostSharp.Core (in PostSharp.Core.dll)
Syntax
| Visual Basic (Declaration) |
|---|
Function RequiresWeave ( _ context As WeavingContext _ ) As Boolean |
| C# |
|---|
bool RequiresWeave( WeavingContext context ) |
| Visual C++ |
|---|
bool RequiresWeave( WeavingContext^ context ) |
Parameters
- context
- Type: PostSharp.CodeWeaver..::.WeavingContext
Weaving context.
Return Value
true if the Weave(WeavingContext, InstructionBlock) method should be called for this join point, otherwise false.Remarks
It is theoretically possible for this method to return always false,
because the Weave(WeavingContext, InstructionBlock) method is not obliged to emit any code. However,
restructuring the method body to make weaving possible is expensive, so the
RequiresWeave(WeavingContext) method should be designed in order to minimize
the number of useless calls to the Weave(WeavingContext, InstructionBlock) method.