public void TestDispose2() { using (var proxy = new LogSourceProxy(_taskScheduler, TimeSpan.Zero, _logFile.Object)) { proxy.Dispose(); _logFile.Verify(l => l.Dispose(), Times.Once); } }
public void Dispose() { // Technically, MergedDataSource holds this list of data sources, however it does NOT // own them and therefore doesn't dispose of them. In this case // we (the folder data source) own those child data sources and thus we must dispose // of them! foreach (var child in OriginalSources) { child.Dispose(); } _watcher?.Dispose(); _unfilteredLogSourceProxy?.Dispose(); _mergedDataSource.Dispose(); _isDisposed = true; }
public void Dispose() { _logSource.Dispose(); _search.Dispose(); _findAllLogSource.Dispose(); _findAllSearch.Dispose(); _logSource?.Dispose(); try { DisposeAdditional(); } catch (Exception e) { Log.ErrorFormat("Caught unexpected exception: {0}", e); } _isDisposed = true; }
protected override void DisposeAdditional() { _originalLogSource?.Dispose(); _unfilteredLogSource?.Dispose(); _multiLineLogSource?.Dispose(); }
protected override void DisposeAdditional() { _unfilteredLogSource.Dispose(); _logSource?.Dispose(); }