System.ComponentModel.AsyncCompletedEventArgs.UserState Property

Gets the unique identifier for the asynchronous task.

Syntax

public object UserState { get; }

Value

Documentation for this section has not yet been entered.

Remarks

If a class supports multiple asynchronous methods, or multiple invocations of a single method, you can determine which task raised the MethodNameCompleted event by checking the value of the AsyncCompletedEventArgs.UserState property. Your code will need track these tokens, known as task IDs, as their corresponding asynchronous tasks start and complete.

The value of this property is set during the original call to the asynchronous method that started the task.

Requirements

Namespace: System.ComponentModel
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0