84 lines
3.3 KiB
C#
84 lines
3.3 KiB
C#
using System;
|
|
using System.Reflection;
|
|
|
|
namespace System.ComponentModel
|
|
{
|
|
/// <summary>Provides data for the MethodNameCompleted event.</summary>
|
|
// Token: 0x02000054 RID: 84
|
|
public class AsyncCompletedEventArgs : EventArgs
|
|
{
|
|
/// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.AsyncCompletedEventArgs" /> class. </summary>
|
|
/// <param name="error">Any error that occurred during the asynchronous operation.</param>
|
|
/// <param name="cancelled">A value indicating whether the asynchronous operation was canceled.</param>
|
|
/// <param name="userState">The optional user-supplied state object passed to the <see cref="M:System.ComponentModel.BackgroundWorker.RunWorkerAsync(System.Object)" /> method.</param>
|
|
// 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;
|
|
}
|
|
|
|
/// <summary>Raises a user-supplied exception if an asynchronous operation failed.</summary>
|
|
/// <exception cref="T:System.InvalidOperationException">The <see cref="P:System.ComponentModel.AsyncCompletedEventArgs.Cancelled" /> property is true. </exception>
|
|
/// <exception cref="T:System.Reflection.TargetInvocationException">The <see cref="P:System.ComponentModel.AsyncCompletedEventArgs.Error" /> property has been set by the asynchronous operation. The <see cref="P:System.Exception.InnerException" /> property holds a reference to <see cref="P:System.ComponentModel.AsyncCompletedEventArgs.Error" />. </exception>
|
|
// 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");
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether an asynchronous operation has been canceled.</summary>
|
|
/// <returns>true if the background operation has been canceled; otherwise false. The default is false.</returns>
|
|
// Token: 0x170000E3 RID: 227
|
|
// (get) Token: 0x06000345 RID: 837 RVA: 0x0000A2D8 File Offset: 0x000084D8
|
|
public bool Cancelled
|
|
{
|
|
get
|
|
{
|
|
return this._cancelled;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating which error occurred during an asynchronous operation.</summary>
|
|
/// <returns>An <see cref="T:System.Exception" /> instance, if an error occurred during an asynchronous operation; otherwise null.</returns>
|
|
// Token: 0x170000E4 RID: 228
|
|
// (get) Token: 0x06000346 RID: 838 RVA: 0x0000A2E0 File Offset: 0x000084E0
|
|
public Exception Error
|
|
{
|
|
get
|
|
{
|
|
return this._error;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the unique identifier for the asynchronous task.</summary>
|
|
/// <returns>An object reference that uniquely identifies the asynchronous task; otherwise, null if no value has been set.</returns>
|
|
// 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;
|
|
}
|
|
}
|