共用方式為


TplExtensions.AttachToParent Method (Task)

Creates a task that is attached to the parent task, but produces the same result as an existing task.

Namespace:  Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function AttachToParent ( _
    task As Task _
) As Task
public static Task AttachToParent(
    this Task task
)
[ExtensionAttribute]
public:
static Task^ AttachToParent(
    Task^ task
)
static member AttachToParent : 
        task:Task -> Task
public static function AttachToParent(
    task : Task
) : Task

Parameters

Return Value

Type: System.Threading.Tasks.Task
A Task<TResult> that is attached to parent.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Task. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

.NET Framework Security

See Also

Reference

TplExtensions Class

AttachToParent Overload

Microsoft.VisualStudio.Threading Namespace