using System;
using System.Reflection;
namespace System.ComponentModel
{
/// Provides data for the MethodNameCompleted event.
// Token: 0x02000054 RID: 84
public class AsyncCompletedEventArgs : EventArgs
{
/// Initializes a new instance of the class.
/// Any error that occurred during the asynchronous operation.
/// A value indicating whether the asynchronous operation was canceled.
/// The optional user-supplied state object passed to the method.
// Token: 0x06000343 RID: 835 RVA: 0x0000A288 File Offset: 0x00008488
public AsyncCompletedEventArgs(Exception error, bool cancelled, object userState)
{
this._error = error;
this._cancelled = cancelled;
this._userState = userState;
}
/// Raises a user-supplied exception if an asynchronous operation failed.
/// The property is true.
/// The property has been set by the asynchronous operation. The property holds a reference to .
// Token: 0x06000344 RID: 836 RVA: 0x0000A2A8 File Offset: 0x000084A8
protected void RaiseExceptionIfNecessary()
{
if (this._error != null)
{
throw new TargetInvocationException(this._error);
}
if (this._cancelled)
{
throw new InvalidOperationException("The operation was cancelled");
}
}
/// Gets a value indicating whether an asynchronous operation has been canceled.
/// true if the background operation has been canceled; otherwise false. The default is false.
// Token: 0x170000E3 RID: 227
// (get) Token: 0x06000345 RID: 837 RVA: 0x0000A2D8 File Offset: 0x000084D8
public bool Cancelled
{
get
{
return this._cancelled;
}
}
/// Gets a value indicating which error occurred during an asynchronous operation.
/// An instance, if an error occurred during an asynchronous operation; otherwise null.
// Token: 0x170000E4 RID: 228
// (get) Token: 0x06000346 RID: 838 RVA: 0x0000A2E0 File Offset: 0x000084E0
public Exception Error
{
get
{
return this._error;
}
}
/// Gets the unique identifier for the asynchronous task.
/// An object reference that uniquely identifies the asynchronous task; otherwise, null if no value has been set.
// Token: 0x170000E5 RID: 229
// (get) Token: 0x06000347 RID: 839 RVA: 0x0000A2E8 File Offset: 0x000084E8
public object UserState
{
get
{
return this._userState;
}
}
// Token: 0x04000112 RID: 274
private Exception _error;
// Token: 0x04000113 RID: 275
private bool _cancelled;
// Token: 0x04000114 RID: 276
private object _userState;
}
}