<PackageReference Include="Nito.AsyncEx.Tasks" Version="5.0.0-pre-05" />

Nito.AsyncEx.Interop.EventAsyncFactory

public static class EventAsyncFactory
Creation methods for tasks wrapping events.
public static Task<EventArguments<TSender, TEventArgs>> FromActionEvent<TSender, TEventArgs>(Action<Action<TSender, TEventArgs>> subscribe, Action<Action<TSender, TEventArgs>> unsubscribe, CancellationToken cancellationToken, bool unsubscribeOnCapturedContext)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type Action<T, U>.

public static Task<EventArguments<TSender, TEventArgs>> FromActionEvent<TSender, TEventArgs>(Action<Action<TSender, TEventArgs>> subscribe, Action<Action<TSender, TEventArgs>> unsubscribe, CancellationToken cancellationToken)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type Action<T, U>.

public static Task<EventArguments<TSender, TEventArgs>> FromActionEvent<TSender, TEventArgs>(Action<Action<TSender, TEventArgs>> subscribe, Action<Action<TSender, TEventArgs>> unsubscribe)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type Action<T, U>.

public static Task<TEventArgs> FromActionEvent<TEventArgs>(Action<Action<TEventArgs>> subscribe, Action<Action<TEventArgs>> unsubscribe, CancellationToken cancellationToken, bool unsubscribeOnCapturedContext)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type Action<T>.

public static Task<TEventArgs> FromActionEvent<TEventArgs>(Action<Action<TEventArgs>> subscribe, Action<Action<TEventArgs>> unsubscribe, CancellationToken cancellationToken)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type Action<T>.

public static Task<TEventArgs> FromActionEvent<TEventArgs>(Action<Action<TEventArgs>> subscribe, Action<Action<TEventArgs>> unsubscribe)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type Action<T>.

public static Task FromActionEvent(Action<Action> subscribe, Action<Action> unsubscribe, CancellationToken cancellationToken, bool unsubscribeOnCapturedContext)

Returns a Task that completes when a specified event next fires. This overload is for events that are of type Action.

public static Task FromActionEvent(Action<Action> subscribe, Action<Action> unsubscribe, CancellationToken cancellationToken)

Returns a Task that completes when a specified event next fires. This overload is for events that are of type Action.

public static Task FromActionEvent(Action<Action> subscribe, Action<Action> unsubscribe)

Returns a Task that completes when a specified event next fires. This overload is for events that are of type Action.

public static Task<TEventArguments> FromAnyEvent<TDelegate, TEventArguments>(Func<Action<TEventArguments>, TDelegate> convert, Action<TDelegate> subscribe, Action<TDelegate> unsubscribe, CancellationToken cancellationToken, bool unsubscribeOnCapturedContext)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of any type.

public static Task<TEventArguments> FromAnyEvent<TDelegate, TEventArguments>(Func<Action<TEventArguments>, TDelegate> convert, Action<TDelegate> subscribe, Action<TDelegate> unsubscribe, CancellationToken cancellationToken)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of any type.

public static Task<TEventArguments> FromAnyEvent<TDelegate, TEventArguments>(Func<Action<TEventArguments>, TDelegate> convert, Action<TDelegate> subscribe, Action<TDelegate> unsubscribe)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of any type.

public static Task<EventArguments<object, EventArgs>> FromEvent(Action<EventHandler> subscribe, Action<EventHandler> unsubscribe, CancellationToken cancellationToken, bool unsubscribeOnCapturedContext)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type EventHandler.

public static Task<EventArguments<object, EventArgs>> FromEvent(Action<EventHandler> subscribe, Action<EventHandler> unsubscribe, CancellationToken cancellationToken)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type EventHandler.

public static Task<EventArguments<object, EventArgs>> FromEvent(Action<EventHandler> subscribe, Action<EventHandler> unsubscribe)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type EventHandler.

public static Task<EventArguments<object, TEventArgs>> FromEvent<TEventArgs>(Action<EventHandler<TEventArgs>> subscribe, Action<EventHandler<TEventArgs>> unsubscribe, CancellationToken cancellationToken, bool unsubscribeOnCapturedContext)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type EventHandler<T>.

public static Task<EventArguments<object, TEventArgs>> FromEvent<TEventArgs>(Action<EventHandler<TEventArgs>> subscribe, Action<EventHandler<TEventArgs>> unsubscribe, CancellationToken cancellationToken)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type EventHandler<T>.

public static Task<EventArguments<object, TEventArgs>> FromEvent<TEventArgs>(Action<EventHandler<TEventArgs>> subscribe, Action<EventHandler<TEventArgs>> unsubscribe)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that are of type EventHandler<T>.

public static Task<EventArguments<object, TEventArgs>> FromEvent<TDelegate, TEventArgs>(Func<EventHandler<TEventArgs>, TDelegate> convert, Action<TDelegate> subscribe, Action<TDelegate> unsubscribe, CancellationToken cancellationToken, bool unsubscribeOnCapturedContext)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that follow the standard sender, eventArgs pattern but with a custom delegate type.

public static Task<EventArguments<object, TEventArgs>> FromEvent<TDelegate, TEventArgs>(Func<EventHandler<TEventArgs>, TDelegate> convert, Action<TDelegate> subscribe, Action<TDelegate> unsubscribe, CancellationToken cancellationToken)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that follow the standard sender, eventArgs pattern but with a custom delegate type.

public static Task<EventArguments<object, TEventArgs>> FromEvent<TDelegate, TEventArgs>(Func<EventHandler<TEventArgs>, TDelegate> convert, Action<TDelegate> subscribe, Action<TDelegate> unsubscribe)

Returns a Task<T> that completes when a specified event next fires. This overload is for events that follow the standard sender, eventArgs pattern but with a custom delegate type.