Ejemplo n.º 1
0
 public void Dispose()
 {
     if (!isDisposed)
     {
         Trace.Dispose();
         isDisposed = true;
     }
 }
Ejemplo n.º 2
0
 public IEnumerable <IAdvice> Advise(MethodInfo method)
 {
     yield return(Advice.Basic.Around(new Func <object, object[], Func <object>, object>((_Instance, _Arguments, _Body) =>
     {
         var _trace = new Trace(method, _Arguments.Select(_Argument => _Argument.ToString()).ToArray());
         try
         {
             var _return = _Body();
             _trace.Dispose(_return.ToString());
             return _return;
         }
         catch (Exception exception)
         {
             _trace.Dispose(exception);
             throw;
         }
     })));
 }
Ejemplo n.º 3
0
 public static void Dispose()
 {
     Log?.Dispose();
     Trace?.Dispose();
     Status?.Dispose();
     Data?.Clear();
     Settings?.Clear();
     Injector?.Dispose();
 }
Ejemplo n.º 4
0
 public void DisposeTrace()
 {
     if (_trace == null)
     {
         return;                 // exit here if trace has already been disposed
     }
     _trace.OnEvent -= OnTraceEventInternal;
     _trace.Drop();
     _trace.Dispose();
     _trace = null;
 }
Ejemplo n.º 5
0
        public void DisposeTrace()
        {
            if (_trace == null)
            {
                return;                 // exit here if trace has already been disposed
            }
            _trace.OnEvent -= OnTraceEventInternal;
            try
            {
                _trace.Drop();
            }
            catch (Exception ex)
            {
                // just log any error, don't rethrow as we are trying to stop the trace anyway
                Log.Error(ex, "{Class} {Method} Exception while dropping query trace {message}", "QueryTraceEngine", "DisposeTrace", ex.Message);
            }

            _trace.Dispose();
            _trace = null;
        }