Open sandboxFocus

Interface IDynamicAdvice

Represents an advice that can be injected dynamically into a dynamically-advisable object.

Namespace: PostSharp.Patterns.DynamicAdvising
Assembly: PostSharp.Patterns.Common.dll
Syntax
public interface IDynamicAdvice : IDynamicInterfaceImplementation
Remarks

Dynamic advices form a chain of responsibility. Specific interfaces derived from IDynamicAdvice (e.g. ICollectionDynamicAdvice<T> or IDictionaryDynamicAdvice<TKey, TValue>) define the semantics of the corresponding specific advised type (e.g. AdvisableCollection<T> or AdvisableDictionary<TKey, TValue>. The last node in the chain of implementation is the actual collection implementation.

Properties

Name Description
Identity

Gets the type identity of the advice, which should correspond to the first parameter of the Advise(Type, Func<IQueryInterface, IDynamicAdvice>) method. This is typically the generic type definition of the advice

Order

Gets the execution order of the dynamic advice. See DynamicAdviceOrder.

Methods

Name Description
Dispose()

Disposes the current advice. // We don't use IDisposable so that advises are not be cast to IDisposable by default.

Initialize(IQueryInterface, AdviceEnumerator<IDynamicAdvice>)

Initializes the current advice.

QueryInterface<T>()

Gets the implementation of an interface.