PostSharpAPI ReferencePost­Sharp.​Patterns.​Dynamic­AdvisingIDynamically­AdvisableAdvise
Open sandboxFocus

IDynamicallyAdvisable.Advise Method

Advise(Type, Func<IQueryInterface, IDynamicAdvice>)

Adds an advice to the object.

Declaration
bool Advise(Type type, Func<IQueryInterface, IDynamicAdvice> createAdvice)
Parameters
Type Name Description
System.Type type

The advice type identity.

System.Func<IQueryInterface, IDynamicAdvice> createAdvice

A delegate that instantiates the advice if it has not yet been added to the object.

Returns
Type Description
Boolean

true if the advice was added, false if it was already added.