Table of Contents

Class TaskType

Namespace
ICSharpCode.Decompiler.TypeSystem
Assembly
ICSharpCode.Decompiler.dll

Helper class for dealing with System.Threading.Tasks.Task.

public static class TaskType
Inheritance
TaskType
Inherited Members

Methods

Create(ICompilation, IType)

Creates a task type.

public static IType Create(ICompilation compilation, IType elementType)

Parameters

compilation ICompilation
elementType IType

Returns

IType

IsCustomTask(IType, out IType)

Gets whether the specified type is a Task-like type.

public static bool IsCustomTask(IType type, out IType builderType)

Parameters

type IType
builderType IType

Returns

bool

IsGenericTaskType(IType, out FullTypeName)

Gets whether the specified type is a generic Task-like type.

public static bool IsGenericTaskType(IType task, out FullTypeName builderTypeName)

Parameters

task IType
builderTypeName FullTypeName

Returns the full type-name of the builder type, if successful.

Returns

bool

IsNonGenericTaskType(IType, out FullTypeName)

Gets whether the specified type is a non-generic Task-like type.

public static bool IsNonGenericTaskType(IType task, out FullTypeName builderTypeName)

Parameters

task IType
builderTypeName FullTypeName

Returns the full type-name of the builder type, if successful.

Returns

bool

IsTask(IType)

Gets whether the specified type is Task or Task<T>.

public static bool IsTask(IType type)

Parameters

type IType

Returns

bool

UnpackTask(ICompilation, IType)

Gets the T in Task<T>. Returns void for non-generic Task. Any other type is returned unmodified.

public static IType UnpackTask(ICompilation compilation, IType type)

Parameters

compilation ICompilation
type IType

Returns

IType