PostSharpAPI ReferencePost­Sharp.​Patterns.​ModelWeak­Event­Attribute
Open sandboxFocus

Class WeakEventAttribute

Aspect that, when applied to an event, prevents the target event from holding a strong reference to event handlers. Therefore, the aspect prevents the event to prevent clients to be garbage collected.

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model.dll
Syntax
[LinesOfCodeAvoided(6)]
[Serializer]
public sealed class WeakEventAttribute : EventInterceptionAspect, IEventLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, IEventInterceptionAspect, IEventLevelAspect, IInstanceScopedAspect, IAspect

Constructors

Name Description
WeakEventAttribute() PostSharp.Patterns.Model.WeakEventAttribute
WeakEventAttribute(PortableFormatterConstructorContext)

Methods

Name Description
Finalize()

Destructor.

OnAddHandler(EventInterceptionArgs)
OnInvokeHandler(EventInterceptionArgs)
OnRemoveHandler(EventInterceptionArgs)
RuntimeInitialize(EventInfo)

Explicit Interface Implementations

Name Description
IInstanceScopedAspect.CreateInstance(AdviceArgs)
IInstanceScopedAspect.RuntimeInitializeInstance()