EventHelperRaiseTEventArgs Method (Delegate, Object, FuncTEventArgs, ActionException, Boolean) |
Raises an event for an event handler.
Namespace: VirtualRadar.InterfaceAssembly: VirtualRadar.Interface (in VirtualRadar.Interface.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static void Raise<TEventArgs>(
Delegate eventHandler,
Object sender,
Func<TEventArgs> buildArgsCallback,
Action<Exception> exceptionCallback = null,
bool throwEventHelperException = false
)
where TEventArgs : EventArgs
Public Shared Sub Raise(Of TEventArgs As EventArgs) (
eventHandler As Delegate,
sender As Object,
buildArgsCallback As Func(Of TEventArgs),
Optional exceptionCallback As Action(Of Exception) = Nothing,
Optional throwEventHelperException As Boolean = false
)
public:
generic<typename TEventArgs>
where TEventArgs : EventArgs
static void Raise(
Delegate^ eventHandler,
Object^ sender,
Func<TEventArgs>^ buildArgsCallback,
Action<Exception^>^ exceptionCallback = nullptr,
bool throwEventHelperException = false
)
static member Raise :
eventHandler : Delegate *
sender : Object *
buildArgsCallback : Func<'TEventArgs> *
?exceptionCallback : Action<Exception> *
?throwEventHelperException : bool
(* Defaults:
let _exceptionCallback = defaultArg exceptionCallback null
let _throwEventHelperException = defaultArg throwEventHelperException false
*)
-> unit when 'TEventArgs : EventArgs
Parameters
- eventHandler
- Type: SystemDelegate
- sender
- Type: SystemObject
- buildArgsCallback
- Type: SystemFuncTEventArgs
- exceptionCallback (Optional)
- Type: SystemActionException
Called whenever an exception is raised. If this is supplied then throwEventHelperException has no effect,
all handlers will be called and this function won't let exceptions thrown by the handlers bubble (unless the callback
throws an exception, in which case an EventHelperException that wraps the exception(s) will be thrown). - throwEventHelperException (Optional)
- Type: SystemBoolean
True if exceptions thrown by event handlers should be wrapped into a single EventHelperException, false if the first
exception thrown by an event handler should be rethrown. If this is false then the first event handler that throws
an exception will stop all other event handlers from being called.
Type Parameters
- TEventArgs
Remarks
Note that this is roughly 6x - 9x slower than a normal event handler call.
See Also