##// END OF EJS Templates
Added IInitializable.Initialize() overload...
Added IInitializable.Initialize() overload Added IRunnable.Start(), IRunnable.Start() overloads Fixed cancellation of the current operation when Stop() is called More tests

File last commit:

r249:d82909310094 v3
r262:f1696cdc3d7a v3.0.8 v3
Show More
ExceptionHelpers.cs
20 lines | 700 B | text/x-csharp | CSharpLexer
using System;
using System.Reflection;
using System.Runtime.ExceptionServices;
namespace Implab {
static class ExceptionHelpers {
public static Exception Rethrow(this Exception that) {
ExceptionDispatchInfo.Capture(that).Throw();
return new TargetInvocationException(that);
}
public static Exception Wrap(this Exception that) {
if (that == null)
return new Exception();
else if (that is OperationCanceledException)
return new OperationCanceledException("The operation has been cancelled", that);
else
return new TargetInvocationException(that);
}
}
}