| Visual Basic (Declaration) | |
|---|---|
Public Property State As Object | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As EndEventArgs Dim value As Object instance.State = value value = instance.State | |
| C# | |
|---|---|
public object State {get; set;} | |
| Managed Extensions for C++ | |
|---|---|
public: __property Object* get_State(); public: __property void set_State( Object* value ); | |
Property Value
An object containing data passed into the calling asynchronous method.The EndEventArgs.State property can be used in the calling asynchronous method to make data accessible to the handling event.
This property is useful for making data accessible to the handling event. Since asynchronous methods are "disconnected" (meaning that when one is called, it executes on it's own and returns in the event handler) data that you were using in the code that called the asynchronous method may not be available in the event handler. Simply pass this data in as state when calling the asynchronous method (usually a BeginXXX method) and it is available in the event handler. If you do not wish to make an object accessible in the EndXXX event, simple pass in null as state.
Target Platforms: Microsoft .NET Framework 2.0
Copy Code