Exemplo n.º 1
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    if (_trace != null)
                    {
                        _trace.OnEvent -= OnTraceEventInternal;
                        _trace?.Drop();
                        _trace?.Dispose();
                        _trace = null;
                    }

                    _connection?.Dispose();
                    _connection = null;

                    _server?.Disconnect();
                    _server?.Dispose();
                    _server = null;

                    if (_startingTimer != null)
                    {
                        _startingTimer.Stop();
                        _startingTimer.Elapsed -= OnTimerElapsed;
                        _startingTimer.Dispose();
                        _startingTimer = null;
                    }
                }

                disposedValue = true;
            }
        }
Exemplo n.º 2
0
 private void OnTimerElapsed(object sender, ElapsedEventArgs e)
 {
     Log.Debug("{class} {method} {event}", "QueryTraceEngineExcel", "OnTimerElapsed", "Ping");
     //HACK - wait 1.5 seconds to allow trace to start
     //       using the ping method thows a connection was lost error when starting a second trace
     Execute.OnUIThread(() => _connection.PingTrace());
     //Execute.OnUIThread(() => ServerPing());
     // if past timeout then exit and display error
     if ((_utcPingStart - DateTime.UtcNow).Seconds > TraceStartTimeoutSecs)
     {
         _startingTimer.Stop();
         _trace.Drop();
         OutputError("Timeout exceeded attempting to start Trace. You could try increasing this timeout in the Options");
         Log.Warning("{class} {method} {event}", "QueryTraceEngineExcel", "OnTimerElapsed", "Timeout exceeded attempting to start Trace");
     }
 }
Exemplo n.º 3
0
 private void OnTimerElapsed(object sender, ElapsedEventArgs e)
 {
     Log.Debug("{class} {method} {event}", "QueryTraceEngineExcel", "OnTimerElapsed", "Ping");
     //HACK - wait 1.5 seconds to allow trace to start
     //       using the ping method thows a connection was lost error when starting a second trace
     Execute.OnUIThread(() => _connection.Ping());
     //Execute.OnUIThread(() => ServerPing());
     // if past timeout then exit and display error
     if ((utcPingStart - DateTime.UtcNow).Seconds > TraceStartTimeoutSecs)
     {
         _startingTimer.Stop();
         _trace.Drop();
         RaiseError("Timeout exceeded attempting to start Trace");
         Log.Warning("{class} {method} {event}", "QueryTraceEngineExcel", "OnTimerElapsed", "Timeout exceeded attempting to start Trace");
     }
     //StopTimer();
     //Status = QueryTraceStatus.Started;
     //_traceStarted = true;
     //if (TraceStarted != null)
     //    TraceStarted(this, null);
 }