Class HandleableExtensions
- Namespace
- Executables.Handling
- Assembly
- executables.dll
Extension methods for handleable objects.
public static class HandleableExtensions
- Inheritance
-
HandleableExtensions
- Inherited Members
Methods
Handle(IHandleable<Unit, Unit>, Action)
Registers a parameterless action as a handler.
public static IDisposable Handle(this IHandleable<Unit, Unit> handleable, Action handler)
Parameters
handleableIHandleable<Unit, Unit>handlerAction
Returns
Handle<T>(IHandleable<Unit, T>, Func<T>)
Registers a parameterless function as a handler.
public static IDisposable Handle<T>(this IHandleable<Unit, T> handleable, Func<T> handler)
Parameters
handleableIHandleable<Unit, T>handlerFunc<T>
Returns
Type Parameters
T
Handle<T>(IHandleable<T, Unit>, Action<T>)
Registers an action as a handler.
public static IDisposable Handle<T>(this IHandleable<T, Unit> handleable, Action<T> handler)
Parameters
handleableIHandleable<T, Unit>handlerAction<T>
Returns
Type Parameters
T
Handle<T1, T2>(IHandleable<T1, T2>, Func<T1, T2>)
Registers a function as a handler.
public static IDisposable Handle<T1, T2>(this IHandleable<T1, T2> handleable, Func<T1, T2> handler)
Parameters
handleableIHandleable<T1, T2>handlerFunc<T1, T2>
Returns
Type Parameters
T1T2
Merge<T1, T2, THandler>(IHandleable<T1, T2, THandler>, IHandleable<T1, T2, THandler>)
Merges two handleables into one registration target.
[Pure]
public static IHandleable<T1, T2, THandler> Merge<T1, T2, THandler>(this IHandleable<T1, T2, THandler> first, IHandleable<T1, T2, THandler> second) where THandler : Handler<T1, T2>
Parameters
firstIHandleable<T1, T2, THandler>First handleable.
secondIHandleable<T1, T2, THandler>Second handleable.
Returns
- IHandleable<T1, T2, THandler>
Composite handleable that registers handlers in both sources.
Type Parameters
T1T2THandler
Exceptions
- ArgumentNullException
secondis null.