Skip to content

Commit b340bd2

Browse files
committed
Refactor OperationCanceledException to be more inline with the style of handling name conflicts (i.e. it already exists in System, so move it to System.Couchbase)
1 parent 31f5534 commit b340bd2

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

System.Threading.Tasks/Task.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ void ThreadStart ()
440440

441441
try {
442442
InnerInvoke ();
443-
} catch (OperationCanceledException_ oce) {
443+
} catch (System.Couchbase.OperationCanceledException oce) {
444444
if (token != CancellationToken.None && oce.CancellationToken == token)
445445
CancelReal ();
446446
else

System.Threading.Tasks/TaskCanceledException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
namespace System.Threading.Tasks
2929
{
3030
[Serializable]
31-
public class TaskCanceledException : OperationCanceledException_
31+
public class TaskCanceledException : System.Couchbase.OperationCanceledException
3232
{
3333
readonly Task task;
3434

System.Threading/CancellationToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public CancellationTokenRegistration Register (Action<object> callback, object s
8484
public void ThrowIfCancellationRequested ()
8585
{
8686
if (source != null && source.IsCancellationRequested)
87-
throw new OperationCanceledException_ (this);
87+
throw new System.Couchbase.OperationCanceledException (this);
8888
}
8989

9090
public bool Equals (CancellationToken other)

System.Threading/ManualResetEventSlim.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public bool Wait (int millisecondsTimeout, CancellationToken cancellationToken)
185185
if (cancellationToken.CanBeCanceled) {
186186
var result = WaitHandle.WaitAny (new[] { handle, cancellationToken.WaitHandle }, millisecondsTimeout, false);
187187
if (result == 1)
188-
throw new OperationCanceledException_ (cancellationToken);
188+
throw new System.Couchbase.OperationCanceledException (cancellationToken);
189189
if (result == WaitHandle.WaitTimeout)
190190
return false;
191191
} else {

System/OperationCanceledException.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,50 +31,50 @@
3131
using System.Runtime.InteropServices;
3232
using System.Threading;
3333

34-
namespace System
34+
namespace System.Couchbase
3535
{
3636
[Serializable]
3737
[ComVisible (true)]
38-
public class OperationCanceledException_ : OperationCanceledException
38+
public class OperationCanceledException : System.OperationCanceledException
3939
{
4040

4141
const int Result = unchecked ((int)0x8013153b);
4242
readonly CancellationToken? token;
4343

4444
// Constructors
45-
public OperationCanceledException_ ()
45+
public OperationCanceledException ()
4646
: base ("The operation was canceled.")
4747
{
4848
}
4949

50-
public OperationCanceledException_ (string message)
50+
public OperationCanceledException (string message)
5151
: base (message)
5252
{
5353
}
5454

55-
public OperationCanceledException_ (string message, Exception innerException)
55+
public OperationCanceledException (string message, Exception innerException)
5656
: base (message, innerException)
5757
{
5858
}
5959

60-
protected OperationCanceledException_ (SerializationInfo info, StreamingContext context)
60+
protected OperationCanceledException (SerializationInfo info, StreamingContext context)
6161
: base (info, context)
6262
{
6363
}
6464

65-
public OperationCanceledException_ (CancellationToken token)
65+
public OperationCanceledException (CancellationToken token)
6666
: this ()
6767
{
6868
this.token = token;
6969
}
7070

71-
public OperationCanceledException_ (string message, CancellationToken token)
71+
public OperationCanceledException (string message, CancellationToken token)
7272
: this (message)
7373
{
7474
this.token = token;
7575
}
7676

77-
public OperationCanceledException_ (string message, Exception innerException, CancellationToken token)
77+
public OperationCanceledException (string message, Exception innerException, CancellationToken token)
7878
: base (message, innerException)
7979
{
8080
this.token = token;

0 commit comments

Comments
 (0)