Open sandboxFocus

Class Event<TDelegate>

Exposes the semantics of an event for use with the ImportMemberAttribute aspect extension.

Inheritance
Event<TDelegate>
Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp.dll
Syntax
public sealed class Event<TDelegate>
Type Parameters
Name Description
TDelegate

The handler type, derived from Delegate.

Remarks

To import an event of the target class, declare a public instance field of type Event<TDelegate> in the aspect class, where TDelegate is the delegate type of the event, and annotate it with ImportMemberAttribute. At run time, the aspect can then add or remove handlers through the Add and Remove delegates.

Properties

Name Description
Add

Gets a delegate that can invoke the add accessor of the imported event.

Remove

Gets a delegate that can invoke the remove accessor of the imported event.

See Also