PostSharp6.0/API Reference/Post­Sharp.​Patterns.​Dynamic­Advising Namespace/IDynamically­Advisable Interface/IDynamically­Advisable Methods/IDynamically­Advisable.​Advise Method

IDynamicallyAdvisable.Advise Method

Adds an advice to the object.

Namespace:  PostSharp.Patterns.DynamicAdvising
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.0.35.0 (6.0.35.0)
Syntax
C#
bool Advise(
	Type type,
	Func<IQueryInterface, IDynamicAdvice> createAdvice
)

Parameters

type
Type: System.Type
The advice type identity.
createAdvice
Type: System.Func<IQueryInterface, IDynamicAdvice>
A delegate that instantiates the advice if it has not yet been added to the object.

Return Value

Type: Boolean
true if the advice was added, false if it was already added.
See Also