Show / Hide Table of Contents

Class SynchronizationContextExtensions

Extension methods for SynchronizationContext.

Inheritance
Object
SynchronizationContextExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: UnityFx.Async.Extensions
Assembly: UnityFx.Async-netstandard2.0.dll
Syntax
public static class SynchronizationContextExtensions

Methods

| Improve this Doc View Source

Invoke(SynchronizationContext, Action)

Dispatches a message to a synchronization context.

Declaration
public static void Invoke(this SynchronizationContext context, Action action)
Parameters
Type Name Description
SynchronizationContext context

The target context.

Action action

The delegate to invoke.

Exceptions
Type Condition
ArgumentNullException

Thrown if action is null.

| Improve this Doc View Source

Invoke(SynchronizationContext, SendOrPostCallback, Object)

Dispatches a message to a synchronization context.

Declaration
public static void Invoke(this SynchronizationContext context, SendOrPostCallback d, object state)
Parameters
Type Name Description
SynchronizationContext context

The target context.

SendOrPostCallback d

The delegate to invoke.

Object state

User-defined state.

Exceptions
Type Condition
ArgumentNullException

Thrown if d is null.

| Improve this Doc View Source

InvokeAsync(SynchronizationContext, Action)

Dispatches a message to a synchronization context.

Declaration
public static IAsyncOperation InvokeAsync(this SynchronizationContext context, Action action)
Parameters
Type Name Description
SynchronizationContext context

The target context.

Action action

The delegate to invoke.

Returns
Type Description
IAsyncOperation

An IAsyncOperation that can be used to track the operation status.

Exceptions
Type Condition
ArgumentNullException

Thrown if action is null.

| Improve this Doc View Source

InvokeAsync(SynchronizationContext, SendOrPostCallback, Object)

Dispatches a message to a synchronization context.

Declaration
public static IAsyncOperation InvokeAsync(this SynchronizationContext context, SendOrPostCallback d, object state)
Parameters
Type Name Description
SynchronizationContext context

The target context.

SendOrPostCallback d

The delegate to invoke.

Object state

User-defined state.

Returns
Type Description
IAsyncOperation

An IAsyncOperation that can be used to track the operation status.

Exceptions
Type Condition
ArgumentNullException

Thrown if d is null.

| Improve this Doc View Source

InvokeAsync<T>(SynchronizationContext, Func<T>)

Dispatches a message to a synchronization context.

Declaration
public static IAsyncOperation<T> InvokeAsync<T>(this SynchronizationContext context, Func<T> action)
Parameters
Type Name Description
SynchronizationContext context

The target context.

System.Func<T> action

The delegate to invoke.

Returns
Type Description
IAsyncOperation<T>

An IAsyncOperation<TResult> that can be used to track the operation status.

Type Parameters
Name Description
T
Exceptions
Type Condition
ArgumentNullException

Thrown if action is null.

| Improve this Doc View Source

Post(SynchronizationContext, Action)

Dispatches an asynchronous message to a synchronization context.

Declaration
public static void Post(this SynchronizationContext context, Action action)
Parameters
Type Name Description
SynchronizationContext context

The target context.

Action action

The delegate to invoke.

Exceptions
Type Condition
ArgumentNullException

Thrown if action is null.

| Improve this Doc View Source

PostAsync(SynchronizationContext, Action)

Dispatches an asynchronous message to a synchronization context.

Declaration
public static IAsyncOperation PostAsync(this SynchronizationContext context, Action action)
Parameters
Type Name Description
SynchronizationContext context

The target context.

Action action

The delegate to invoke.

Returns
Type Description
IAsyncOperation

An IAsyncOperation that can be used to track the operation status.

Exceptions
Type Condition
ArgumentNullException

Thrown if action is null.

| Improve this Doc View Source

PostAsync(SynchronizationContext, SendOrPostCallback, Object)

Dispatches an asynchronous message to a synchronization context.

Declaration
public static IAsyncOperation PostAsync(this SynchronizationContext context, SendOrPostCallback d, object state)
Parameters
Type Name Description
SynchronizationContext context

The target context.

SendOrPostCallback d

The delegate to invoke.

Object state

User-defined state.

Returns
Type Description
IAsyncOperation

An IAsyncOperation that can be used to track the operation status.

Exceptions
Type Condition
ArgumentNullException

Thrown if d is null.

| Improve this Doc View Source

PostAsync<T>(SynchronizationContext, Func<T>)

Dispatches an asynchronous message to a synchronization context.

Declaration
public static IAsyncOperation<T> PostAsync<T>(this SynchronizationContext context, Func<T> action)
Parameters
Type Name Description
SynchronizationContext context

The target context.

System.Func<T> action

The delegate to invoke.

Returns
Type Description
IAsyncOperation<T>

An IAsyncOperation<TResult> that can be used to track the operation status.

Type Parameters
Name Description
T
Exceptions
Type Condition
ArgumentNullException

Thrown if action is null.

| Improve this Doc View Source

Send(SynchronizationContext, Action)

Dispatches an synchronous message to a synchronization context.

Declaration
public static void Send(this SynchronizationContext context, Action action)
Parameters
Type Name Description
SynchronizationContext context

The target context.

Action action

The delegate to invoke.

Exceptions
Type Condition
ArgumentNullException

Thrown if action is null.

| Improve this Doc View Source

Send<T>(SynchronizationContext, Func<T>)

Dispatches an synchronous message to a synchronization context.

Declaration
public static T Send<T>(this SynchronizationContext context, Func<T> action)
Parameters
Type Name Description
SynchronizationContext context

The target context.

System.Func<T> action

The delegate to invoke.

Returns
Type Description
T

Returns result of the action call.

Type Parameters
Name Description
T
Exceptions
Type Condition
ArgumentNullException

Thrown if action is null.

  • Improve this Doc
  • View Source
Back to top Copyright (c) 2017-2018 Alexander Bogarsukov