PostSharpAPI ReferencePost­Sharp.​AspectsIAspect­ProviderProvide­Aspects
Open sandboxFocus

IAspectProvider.ProvideAspects Method

ProvideAspects(Object)

Provides new aspects.

Declaration
IEnumerable<AspectInstance> ProvideAspects(object targetElement)
Parameters
Type Name Description
Object targetElement

Code element (Assembly, Type, FieldInfo, System.Reflection.MethodBase, PropertyInfo, System.Reflection.EventInfo, ParameterInfo, or LocationInfo) to which the current aspect has been applied.

Returns
Type Description
IEnumerable<AspectInstance>

A set of aspect instances.

Remarks

Implementations of this method are only allowed to return aspect instances applied on elements of code located under the target element of code (targetElement). For instance, a type-level IAspectProvider can provide aspects on methods of the current type, but not of other types.