Table of Contents

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

handling Func<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

T1
T2

Exceptions

ArgumentNullException

handling is 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

add Action<Action>

Action that subscribes a delegate to the source event.

remove Action<Action>

Action that unsubscribes a delegate from the source event.

Returns

IHandleable<Unit, Unit>

Handleable wrapping the event subscription lifecycle.

Exceptions

ArgumentNullException

add or remove is 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

add Action<Action<T>>

Action that subscribes a delegate to the source event.

remove Action<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

add or remove is 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

add Action<Func<T1, T2>>

Action that subscribes a delegate to the source event.

remove Action<Func<T1, T2>>

Action that unsubscribes a delegate from the source event.

Returns

IHandleable<T1, T2>

Handleable wrapping the event subscription lifecycle.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

add or remove is null.