253
|
1 using System;
|
|
2 using System.Diagnostics;
|
|
3
|
|
4 namespace Implab.Diagnostics {
|
|
5 public class LogicalOperationScope : IDisposable {
|
|
6 readonly TraceSource m_source;
|
|
7
|
|
8 readonly LogicalOperation m_operation;
|
|
9
|
|
10 internal LogicalOperationScope(TraceSource source, LogicalOperation operation) {
|
|
11 m_source = source;
|
|
12 m_operation = operation;
|
|
13 }
|
|
14
|
|
15 public void Dispose() {
|
|
16 m_operation.OperationStopwatch.Stop();
|
|
17 Trace.CorrelationManager.StopLogicalOperation();
|
|
18 m_source.TraceData(TraceEventType.Information, TraceEventCodes.StopLogicalOperation, m_operation);
|
|
19 }
|
|
20 }
|
|
21 } |