コード例 #1
0
 public void TestDispose2()
 {
     using (var proxy = new LogSourceProxy(_taskScheduler, TimeSpan.Zero, _logFile.Object))
     {
         proxy.Dispose();
         _logFile.Verify(l => l.Dispose(), Times.Once);
     }
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
 protected override void DisposeAdditional()
 {
     _originalLogSource?.Dispose();
     _unfilteredLogSource?.Dispose();
     _multiLineLogSource?.Dispose();
 }
コード例 #5
0
 protected override void DisposeAdditional()
 {
     _unfilteredLogSource.Dispose();
     _logSource?.Dispose();
 }