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
task
Type: System.Threading.Tasks.TaskThe task to wrap with an AttachedToParent task.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.