Share via


JoinableTaskCollection Class

Definition

A collection of incomplete JoinableTask objects.

public ref class JoinableTaskCollection : System::Collections::Generic::IEnumerable<Microsoft::VisualStudio::Threading::JoinableTask ^>
[System.Diagnostics.DebuggerDisplay("JoinableTaskCollection: {displayName ?? "(anonymous)"}")]
public class JoinableTaskCollection : System.Collections.Generic.IEnumerable<Microsoft.VisualStudio.Threading.JoinableTask>
[<System.Diagnostics.DebuggerDisplay("JoinableTaskCollection: {displayName ?? "(anonymous)"}")>]
type JoinableTaskCollection = class
    interface seq<JoinableTask>
    interface IEnumerable
Public Class JoinableTaskCollection
Implements IEnumerable(Of JoinableTask)
Inheritance
JoinableTaskCollection
Attributes
Implements

Remarks

Any completed JoinableTask is automatically removed from the collection.

Constructors

JoinableTaskCollection(JoinableTaskContext, Boolean)

Initializes a new instance of the JoinableTaskCollection class.

Properties

Context

Gets the JoinableTaskContext to which this collection belongs.

DisplayName

Gets or sets a human-readable name that may appear in hang reports.

Methods

Add(JoinableTask)

Adds the specified JoinableTask to this collection.

Contains(JoinableTask)

Checks whether the specified joinable task is a member of this collection.

GetEnumerator()

Enumerates the tasks in this collection.

Join()

Shares access to the main thread that the caller's JoinableTask may have (if any) with all JoinableTask instances in this collection until the returned value is disposed.

JoinTillEmptyAsync()

Joins the caller's context to this collection till the collection is empty.

JoinTillEmptyAsync(CancellationToken)

Joins the caller's context to this collection till the collection is empty.

Remove(JoinableTask)

Removes the specified JoinableTask from this collection, or decrements the ref count if this collection tracks that.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Enumerates the tasks in this collection.

Extension Methods

EmptyIfNull<T>(IEnumerable<T>)

Return this enumeration in case it is not null. In case it is null return empty enumeration.

Applies to

Thread Safety

This type is thread-safe for all members.