92
|
1 namespace Implab.Diagnostics {
|
|
2 public static class Extensions {
|
|
3 public static IPromise<T> EndLogicalOperation<T>(this IPromise<T> promise) {
|
|
4 Safe.ArgumentNotNull(promise, "promise");
|
|
5 var op = TraceContext.Instance.DetachLogicalOperation();
|
|
6
|
|
7 return promise.Anyway(() => {
|
|
8 TraceContext.Instance.EnterLogicalOperation(op,true);
|
|
9 TraceLog.EndLogicalOperation();
|
|
10 TraceContext.Instance.Leave();
|
|
11 });
|
|
12 }
|
94
|
13
|
|
14 public static IPromise EndLogicalOperation(this IPromise promise) {
|
|
15 Safe.ArgumentNotNull(promise, "promise");
|
|
16 var op = TraceContext.Instance.DetachLogicalOperation();
|
|
17
|
|
18 return promise.Anyway(() => {
|
|
19 TraceContext.Instance.EnterLogicalOperation(op,true);
|
|
20 TraceLog.EndLogicalOperation();
|
|
21 TraceContext.Instance.Leave();
|
|
22 });
|
|
23 }
|
92
|
24 }
|
|
25 }
|
|
26
|