PostSharp6.0/API Reference/Post­Sharp.​Patterns.​Dynamic­Advising Namespace/IDynamic­Advice Interface

IDynamicAdvice Interface

Represents an advice that can be injected dynamically into a dynamically-advisable 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#
public interface IDynamicAdvice : IDynamicInterfaceImplementation

The IDynamicAdvice type exposes the following members.

Properties
  NameDescription
Public propertyAdvisedObject
Gets the principal object for which the current object is an indirect interface implementation.
(Inherited from IDynamicInterfaceImplementation.)
Public propertyIdentity
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
Public propertyOrder
Gets the execution order of the dynamic advice. See DynamicAdviceOrder.
Methods
  NameDescription
Public methodDispose
Disposes the current advice. // We don't use IDisposable so that advises are not be cast to IDisposable by default.
Public methodInitialize
Initializes the current advice.
Public methodQueryInterface<T>
Gets the implementation of an interface.
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.

See Also