Assembly: PostSharp (in PostSharp.dll) Version: 220.127.116.11 (18.104.22.168)
public interface IInstanceScopedAspect : IAspect
Thetype exposes the following members.
Creates a new instance of the aspect based on the current instance, serving as a prototype.
Initializes the aspect instance. This method is invoked when all system elements of the aspect (like member imports) have completed.
When an aspect is instance-scoped, a new instance of this aspect is created whenever an instance of the type to which it has been applied is created (concretely, before the call to the base constructor and the own constructor of this type).
New aspect instances are obtained using the prototype design pattern. As any other aspect, an instance-scope aspect has a static instance initialized at build time, then serialized, deserialized at runtime, and initialized by RuntimeInitialize. This static instance then serves as a prototype. When a new instance of the target type is created, the prototype is cloned by the method CreateInstance(AdviceArgs) (typically implemented by a call to MemberwiseClone()). Then some system initializations (for instance member import) are performed on the aspect instance, and finally the RuntimeInitializeInstance() method is invoked.
When an aspect implementing theinterface is applied on a static method, field, property, or event, the aspect will be statically scoped and the interface will be ignored.