comparison Implab/Diagnostics/LogicalOperationScope.cs @ 253:34df34841225 v3 v3.0.1-beta

Implab.Diagnostics drafts
author cin
date Mon, 12 Feb 2018 17:03:37 +0300
parents
children
comparison
equal deleted inserted replaced
252:6f4630d0bcd9 253:34df34841225
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 }