Class Handleable
- Namespace
- Executables.Handling
- Assembly
- executables.dll
Factory methods for creating handleables.
public static class Handleable
- Inheritance
-
Handleable
- Inherited Members
Methods
Create<T1, T2>(Func<Handler<T1, T2>, IDisposable>)
Creates a handleable from a registration delegate.
[Pure]
public static IHandleable<T1, T2> Create<T1, T2>(Func<Handler<T1, T2>, IDisposable> handling)
Parameters
handlingFunc<Handler<T1, T2>, IDisposable>Delegate that registers a handler and returns a handle for unregistering it.
Returns
- IHandleable<T1, T2>
Handleable backed by
handling.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
handlingis null.
FromEvent(Action<Action>, Action<Action>)
Creates a handleable from a parameterless event.
[Pure]
public static IHandleable<Unit, Unit> FromEvent(Action<Action> add, Action<Action> remove)
Parameters
addAction<Action>Action that subscribes a delegate to the source event.
removeAction<Action>Action that unsubscribes a delegate from the source event.
Returns
- IHandleable<Unit, Unit>
Handleable wrapping the event subscription lifecycle.
Exceptions
- ArgumentNullException
addorremoveis null.
FromEvent<T>(Action<Action<T>>, Action<Action<T>>)
Creates a handleable from an event with typed action handlers.
[Pure]
public static IHandleable<T, Unit> FromEvent<T>(Action<Action<T>> add, Action<Action<T>> remove)
Parameters
addAction<Action<T>>Action that subscribes a delegate to the source event.
removeAction<Action<T>>Action that unsubscribes a delegate from the source event.
Returns
- IHandleable<T, Unit>
Handleable wrapping the event subscription lifecycle.
Type Parameters
T
Exceptions
- ArgumentNullException
addorremoveis null.
FromEvent<T1, T2>(Action<Func<T1, T2>>, Action<Func<T1, T2>>)
Creates a handleable from an event with add and remove accessors.
[Pure]
public static IHandleable<T1, T2> FromEvent<T1, T2>(Action<Func<T1, T2>> add, Action<Func<T1, T2>> remove)
Parameters
addAction<Func<T1, T2>>Action that subscribes a delegate to the source event.
removeAction<Func<T1, T2>>Action that unsubscribes a delegate from the source event.
Returns
- IHandleable<T1, T2>
Handleable wrapping the event subscription lifecycle.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
addorremoveis null.