Open sandboxFocus

Property RaiseMethod

RaiseMethod

Gets an object that represents the raise semantic and allows to add aspects and advice as with a normal method, or null if the event cannot be raised.

Declaration
IMethod? RaiseMethod { get; }
Property Value
Type Description
IMethod
Remarks

In C#, only field-like events (events without explicit add/remove accessors) can be raised because they have a backing delegate field. For non-field-like events (events with explicit accessors), there is no backing delegate to invoke, so this property returns null.

Use the CanRaise property to programmatically check whether an event can be raised before attempting to use this property or the Raise(params dynamic?[]) method.