Unosquare
    Show / Hide Table of Contents

    Class TaskExtensions

    Provides extension methods for and .

    Inheritance
    Object
    TaskExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Swan
    Syntax
    public static class TaskExtensions

    Methods

    Await(Task)

    Suspends execution until the specified is completed.

    This method operates similarly to the await C# operator, but is meant to be called from a non-async method.

    Declaration
    public static void Await(this Task this)
    Parameters
    Type Name Description
    Task this

    The on which this method is called.

    Await(Task, Boolean)

    Suspends execution until the specified is completed.

    This method operates similarly to the await C# operator, but is meant to be called from a non-async method.

    Declaration
    public static void Await(this Task this, bool continueOnCapturedContext)
    Parameters
    Type Name Description
    Task this

    The on which this method is called.

    Boolean continueOnCapturedContext

    If set to true, attempts to marshal the continuation back to the original context captured. This parameter has the same effect as calling the method.

    Await<TResult>(Task<TResult>)

    Suspends execution until the specified is completed and returns its result.

    This method operates similarly to the await C# operator, but is meant to be called from a non-async method.

    Declaration
    public static TResult Await<TResult>(this Task<TResult> this)
    Parameters
    Type Name Description
    Task<TResult> this

    The on which this method is called.

    Returns
    Type Description
    TResult

    The result of this.

    Type Parameters
    Name Description
    TResult

    The type of the task's result.

    Await<TResult>(Task<TResult>, Boolean)

    Suspends execution until the specified is completed and returns its result.

    This method operates similarly to the await C# operator, but is meant to be called from a non-async method.

    Declaration
    public static TResult Await<TResult>(this Task<TResult> this, bool continueOnCapturedContext)
    Parameters
    Type Name Description
    Task<TResult> this

    The on which this method is called.

    Boolean continueOnCapturedContext

    If set to true, attempts to marshal the continuation back to the original context captured. This parameter has the same effect as calling the method.

    Returns
    Type Description
    TResult

    The result of this.

    Type Parameters
    Name Description
    TResult

    The type of the task's result.

    Comments

    Back to top Copyright © 2017-2019 Unosquare