protected override void Dispose(bool disposing) { _Monitor.Stop(); _Monitor.Dispose(); _Manager.Dispose(); base.Dispose(disposing); }
protected override void Dispose(bool disposing) { _Logger.Information("Deinitializing resources"); _Monitor.Stop(); _Monitor.Dispose(); _Manager.Dispose(); base.Dispose(disposing); }
public void ShouldDisposeCleanly() { IElasticClient elasticClient = A.Fake <IElasticClient>(); TestScheduler testScheduler = new TestScheduler(); IMonitorFactory <TestMessage> factory = new ElasticSearchMonitorFactory <TestMessage>("indexName", new List <Type>(), "instanceName", TimeSpan.FromSeconds(1), testScheduler, elasticClient); IMonitor <TestMessage> monitor = factory.Create("SomeName"); monitor.Dispose(); }
internal void Replace(IMonitor monitor) { if (monitor?.IsReachable is true) { lock (_lock) { this._monitor.Dispose(); this._monitor = monitor; } } else { monitor?.Dispose(); } }
protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { // Dispose managed resources. if (monitor != null) { monitor.Dispose(); MessageAnalyzerMonitor.instance = null; } } disposed = true; } }
protected override void Dispose(bool disposing) { if (_isDisposed) { return; } if (disposing) { _monitor.Dispose(); } _isDisposed = true; base.Dispose(disposing); }
public bool FreeMonitor(string name) { lock (mMonitors.SyncRoot) { IMonitor monitor = mMonitors[name] as IMonitor; if (monitor != null && monitor.Verify(ACOpts.Exec_Cleanup)) { mMonitors.Remove(name); monitor.Dispose(); return(true); } } return(false); }
public void Dispose() { _endpointClient.Dispose(); _monitor.Dispose(); }
public void Dispose() { _monitoredCashRegister.Dispose(); }
protected override void Cleanup() { _sut?.Dispose(); _monitorEvents.Dispose(); }