In PostSharp, a binding was a run-time object that allowed the run-time code of the aspect to call the target code. In Metalama, aspects no longer have run-time code. Instead, they have templates that are expanded at compile time and generate run-time code. Templates can generate run-time code that accesses target code using dynamic code or invokers. For events, use meta.Target.Event.Add(IExpression), Remove(IExpression) or Raise(params IExpression[])
Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
[InternalImplement]
[Obsolete("In PostSharp, a binding was a run-time object that allowed the run-time code of the aspect to call the target code. In Metalama, aspects no longer have run-time code. Instead, they have templates that are expanded at compile time and generate run-time code. Templates can generate run-time code that accesses target code using dynamic code or invokers. For events, use 'meta'.'meta.Target'.'IMetaTarget.Event'.'IEventInvoker.Add(IExpression)', 'IEventInvoker.Remove(IExpression)' or 'IEventInvoker.Raise(params IExpression[])'", false)]
public interface IEventBindingMethods
| Name | Description |
|---|---|
| AddHandler(ref object, Delegate) | In Metalama, use meta.Target.Event.Add(IExpression). |
| InvokeHandler(ref object, Delegate, Arguments) | In Metalama, generate run-time code that invokes the handler. |
| RemoveHandler(ref object, Delegate) | In Metalama, use meta.Target.Event.Remove(IExpression). |