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 (such as ICollectionDynamicAdvice<T> or IDictionaryDynamicAdvice<TKey, TValue>) define the semantics of the corresponding specific advised type (such as 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 do not use IDisposable so that advices are not cast to IDisposable by default.

Initialize(IQueryInterface, AdviceEnumerator<IDynamicAdvice>)

Initializes the current advice.

QueryInterface<T>()

Gets the implementation of an interface.