mscorlib(4.0.0.0) API with additions
OperationCanceledException.cs
3 using System.Threading;
4 
5 namespace System
6 {
9  [ComVisible(true)]
10  [__DynamicallyInvokable]
12  {
13  [NonSerialized]
14  private CancellationToken _cancellationToken;
15 
18  [__DynamicallyInvokable]
20  {
21  [__DynamicallyInvokable]
22  get
23  {
24  return _cancellationToken;
25  }
26  private set
27  {
28  _cancellationToken = value;
29  }
30  }
31 
33  [__DynamicallyInvokable]
35  : base(Environment.GetResourceString("OperationCanceled"))
36  {
37  SetErrorCode(-2146233029);
38  }
39 
42  [__DynamicallyInvokable]
43  public OperationCanceledException(string message)
44  : base(message)
45  {
46  SetErrorCode(-2146233029);
47  }
48 
52  [__DynamicallyInvokable]
53  public OperationCanceledException(string message, Exception innerException)
54  : base(message, innerException)
55  {
56  SetErrorCode(-2146233029);
57  }
58 
61  [__DynamicallyInvokable]
63  : this()
64  {
65  CancellationToken = token;
66  }
67 
71  [__DynamicallyInvokable]
72  public OperationCanceledException(string message, CancellationToken token)
73  : this(message)
74  {
75  CancellationToken = token;
76  }
77 
82  [__DynamicallyInvokable]
83  public OperationCanceledException(string message, Exception innerException, CancellationToken token)
84  : this(message, innerException)
85  {
86  CancellationToken = token;
87  }
88 
93  : base(info, context)
94  {
95  }
96  }
97 }
Propagates notification that operations should be canceled.
Serves as the base class for system exceptions namespace.
Definition: __Canon.cs:3
Describes the source and destination of a given serialized stream, and provides an additional caller-...
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
OperationCanceledException(string message, Exception innerException)
Initializes a new instance of the T:System.OperationCanceledException class with a specified error me...
OperationCanceledException(string message)
Initializes a new instance of the T:System.OperationCanceledException class with a specified error me...
OperationCanceledException(CancellationToken token)
Initializes a new instance of the T:System.OperationCanceledException class with a cancellation token...
OperationCanceledException()
Initializes a new instance of the T:System.OperationCanceledException class with a system-supplied er...
OperationCanceledException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the T:System.OperationCanceledException class with serialized data.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
OperationCanceledException(string message, CancellationToken token)
Initializes a new instance of the T:System.OperationCanceledException class with a specified error me...
The exception that is thrown in a thread upon cancellation of an operation that the thread was execut...
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Definition: Exception.cs:22
Specifies that the class can be serialized.
OperationCanceledException(string message, Exception innerException, CancellationToken token)
Initializes a new instance of the T:System.OperationCanceledException class with a specified error me...