Amazon.KinesisTap.Windows/EventLogSource.cs
/// <summary>
/// Shutdown the watcher for this source, and invoke the base method which will wait until the service this source depends on (EventLog) is back to running state.
/// The base method will call AfterDependencyRunning once the dependent service is running again.
/// </summary>
Shutdown the watcher for this source, and invoke the base method which will wait until the service this source depends on (EventLog) is back to running state.
The base method will call AfterDependencyRunning once the dependent service is running again.
Shutdown the watcher for this source and invoke the base method which will wait until the service this source depends on ( EventLog ) is back to running state . The base method will call AfterDependencyRunning once the dependent service is running again .
public override void Reset()
        {
            if (_watcher != null)
            {
                _logger?.LogWarning($"Resetting EventLogSource id {this.Id}.");
                try
                {
                    Task.Run(() => _watcher.Enabled = false).Wait(1000);
                }
                catch (Exception e)
                {
                    _logger?.LogWarning($"Unable to disable EventLogSource watcher id {this.Id} logging {_logName} EventLog with query {_query}.  Errors: {GetExceptionContent(e)}");
                }
                try
                {
                    _watcher.Dispose();
                    _watcher = null;
                    _logger?.LogInformation($"EventLogSource {this.Id} logging {_logName} EventLog with query {_query} stopped during reset.");
                }
                catch (Exception e)
                {
                    _logger?.LogError($"Disposal of watcher failed during reset of EventLogSource {this.Id} logging {_logName} with query {_query}.  Error: {e}");
                }
            }
            base.Reset();
        }
public override void Reset ( ) { if ( _watcher != null ) { _logger ? . LogWarning ( $" Resetting EventLogSource id  { this . Id } . " ) ; try { Task . Run ( ( ) => _watcher . Enabled = false ) . Wait ( 1000 ) ; } catch ( Exception e ) { _logger ? . LogWarning ( $" Unable to disable EventLogSource watcher id  { this . Id }  logging  { _logName }  EventLog with query  { _query } .  Errors:  { GetExceptionContent ( e ) } " ) ; } try { _watcher . Dispose ( ) ; _watcher = null ; _logger ? . LogInformation ( $" EventLogSource  { this . Id }  logging  { _logName }  EventLog with query  { _query }  stopped during reset. " ) ; } catch ( Exception e ) { _logger ? . LogError ( $" Disposal of watcher failed during reset of EventLogSource  { this . Id }  logging  { _logName }  with query  { _query } .  Error:  { e } " ) ; } } base . Reset ( ) ; }
Shutdown the watcher for this source, and invoke the base method which will wait until the service this source depends on (EventLog) is back to running state.
Shutdown the watcher for this source and invoke the base method which will wait until the service this source depends on ( EventLog ) is back to running state .