Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

AopUtils.CanApply(IAdvisor, Type, Type, Boolean) Method

Can the supplied advisor apply at all on the supplied targetType?

[Visual Basic]
Public Overloads Shared Sub CanApply( _
   ByVal advisor As IAdvisor, _
   ByVal targetType As Type, _
   ByVal proxyInterfaces As Type, _
   ByVal hasIntroductions As Boolean _
)
[C#]
public static bool CanApply(
   IAdvisor advisor,
   Type targetType,
   Type[] proxyInterfaces,
   bool hasIntroductions
);

Parameters

advisor
The advisor to check.
targetType
The class being tested.
proxyInterfaces
The interfaces being proxied. If a null reference (Nothing in Visual Basic), all methods on a class may be proxied.
hasIntroductions
whether or not the advisor chain for the target object includes any introductions.

Return Value

true if the advisor can apply on any method.

Remarks

This is an important test as it can be used to optimize out an advisor for a class.

See Also

AopUtils Class | Spring.Aop.Framework Namespace | AopUtils.CanApply Overload List