Class HookRegistry
Namespace: DotBoxD.Plugins.Runtime
Assembly: DotBoxD.Plugins.dll
public sealed class HookRegistryInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
Section titled “Methods”FireAsync<TContext, TResult>(TContext, CancellationToken)
Section titled “ FireAsync<TContext, TResult>(TContext, CancellationToken)”Dispatches the result-returning hooks (.Register(…) / .RegisterLocal(…)) installed for
TContext in descending priority order, returning the first successful
TResult or null when none is registered or none succeeds. The
host applies the returned result to its live state. The result type is named explicitly here because the
host — unlike the plugin authoring side, where it is inferred from the [Hook] context — already
knows the type it will apply.
public ValueTask<TResult?> FireAsync<TContext, TResult>(TContext context, CancellationToken cancellationToken = default) where TResult : struct, IHookResultParameters
Section titled “Parameters”context TContext
cancellationToken CancellationToken
Returns
Section titled “Returns”ValueTask<TResult?>
Type Parameters
Section titled “Type Parameters”TContext
TResult
FireAsync<TContext, TResult>(TContext, ResultHookDispatchOptions<TResult>, CancellationToken)
Section titled “ FireAsync<TContext, TResult>(TContext, ResultHookDispatchOptions<TResult>, CancellationToken)”public ValueTask<TResult?> FireAsync<TContext, TResult>(TContext context, ResultHookDispatchOptions<TResult> options, CancellationToken cancellationToken = default) where TResult : struct, IHookResultParameters
Section titled “Parameters”context TContext
options ResultHookDispatchOptions<TResult>
cancellationToken CancellationToken
Returns
Section titled “Returns”ValueTask<TResult?>
Type Parameters
Section titled “Type Parameters”TContext
TResult
On<TEvent>()
Section titled “ On<TEvent>()”public HookPipeline<TEvent, HookContext> On<TEvent>()Returns
Section titled “Returns”HookPipeline<TEvent, HookContext>
Type Parameters
Section titled “Type Parameters”TEvent
On<TEvent>(IPluginEventAdapter<TEvent>)
Section titled “ On<TEvent>(IPluginEventAdapter<TEvent>)”public HookPipeline<TEvent, HookContext> On<TEvent>(IPluginEventAdapter<TEvent> adapter)Parameters
Section titled “Parameters”adapter IPluginEventAdapter<TEvent>
Returns
Section titled “Returns”HookPipeline<TEvent, HookContext>
Type Parameters
Section titled “Type Parameters”TEvent
On<TEvent, TContext>(Func<HookContext, TContext>)
Section titled “ On<TEvent, TContext>(Func<HookContext, TContext>)”public HookPipeline<TEvent, TContext> On<TEvent, TContext>(Func<HookContext, TContext> createContext)Parameters
Section titled “Parameters”createContext Func<HookContext, TContext>
Returns
Section titled “Returns”HookPipeline<TEvent, TContext>
Type Parameters
Section titled “Type Parameters”TEvent
TContext
On<TEvent, TContext>(IPluginEventAdapter<TEvent>, Func<HookContext, TContext>)
Section titled “ On<TEvent, TContext>(IPluginEventAdapter<TEvent>, Func<HookContext, TContext>)”public HookPipeline<TEvent, TContext> On<TEvent, TContext>(IPluginEventAdapter<TEvent> adapter, Func<HookContext, TContext> createContext)Parameters
Section titled “Parameters”adapter IPluginEventAdapter<TEvent>
createContext Func<HookContext, TContext>
Returns
Section titled “Returns”HookPipeline<TEvent, TContext>
Type Parameters
Section titled “Type Parameters”TEvent
TContext
PublishAsync<TEvent>(TEvent, CancellationToken)
Section titled “ PublishAsync<TEvent>(TEvent, CancellationToken)”public ValueTask PublishAsync<TEvent>(TEvent e, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”e TEvent
cancellationToken CancellationToken
Returns
Section titled “Returns”Type Parameters
Section titled “Type Parameters”TEvent