Пример #1
0
 public void Dispose()
 {
     if (_disposeToken.TryMarkDisposed())
     {
         _textBuffer?.RemoveService(this);
     }
 }
Пример #2
0
 public void Dispose()
 {
     if (_disposeToken.TryMarkDisposed())
     {
         ServiceManager.RemoveService <SignatureHelpSource>(_textBuffer);
     }
 }
Пример #3
0
        protected virtual void Dispose(bool disposing)
        {
            _diagnosticsService?.Remove(Uri);
            _disposeToken.TryMarkDisposed();
            var analyzer = Services.GetService <IPythonAnalyzer>();

            analyzer.RemoveAnalysis(this);
        }
 public override Task DisposeAsync(RunSummary result, IMessageBus messageBus)
 {
     if (!_disposeToken.TryMarkDisposed())
     {
         return(Task.CompletedTask);
     }
     _compositionContainer.Dispose();
     return(base.DisposeAsync(result, messageBus));
 }
Пример #5
0
        public void Dispose()
        {
            if (!_disposeToken.TryMarkDisposed())
            {
                return;
            }

            _host?.Dispose();
            Disposed?.Invoke(this, EventArgs.Empty);
            _onDispose();
        }
Пример #6
0
        public void Dispose()
        {
            if (!_disposeToken.TryMarkDisposed())
            {
                return;
            }

            foreach (var session in _sessions.Values)
            {
                session.Dispose();
            }
        }
Пример #7
0
 public void Dispose()
 {
     if (_disposeToken.TryMarkDisposed())
     {
         //foreach (var service in _s.Values) {
         //    if (service is Lazy<object> lazy && lazy.IsValueCreated) {
         //        (lazy.Value as IDisposable)?.Dispose();
         //    } else {
         //        (service as IDisposable)?.Dispose();
         //    }
         //}
     }
 }
Пример #8
0
        public void Dispose()
        {
            if (!_disposeToken.TryMarkDisposed())
            {
                return;
            }

            if (_rSession != null)
            {
                _rSession.Mutated -= RSession_Mutated;
                _rSession          = null;
            }
        }
Пример #9
0
 public void Dispose()
 {
     if (_disposeToken.TryMarkDisposed())
     {
         foreach (var service in _s.Values)
         {
             var lazy = service as Lazy <object>;
             if (lazy != null && lazy.IsValueCreated)
             {
                 (lazy.Value as IDisposable)?.Dispose();
             }
             else
             {
                 (service as IDisposable)?.Dispose();
             }
         }
     }
 }
Пример #10
0
        public void Dispose()
        {
            if (!_disposeToken.TryMarkDisposed())
            {
                return;
            }

            var sessions      = GetSessions().ToList();
            var stopHostTasks = sessions.Select(session => session.StopHostAsync(false));

            try {
                _services.Tasks().Wait(Task.WhenAll(stopHostTasks));
            } catch (Exception ex) when(!ex.IsCriticalException())
            {
            }

            foreach (var session in sessions)
            {
                session.Dispose();
            }

            Broker.Dispose();
        }
 public void Dispose()
 {
     _progress.Dispose();
     _disposeToken.TryMarkDisposed();
 }
Пример #12
0
 protected virtual void Dispose(bool disposing)
 {
     _diagnosticsService?.Remove(Uri);
     _disposeToken.TryMarkDisposed();
 }
Пример #13
0
 public void Dispose() => _disposeToken.TryMarkDisposed();
Пример #14
0
 public void TryMarkDisposed()
 {
     _disposeToken.IsDisposed.Should().BeFalse();
     _disposeToken.TryMarkDisposed().Should().BeTrue();
     _disposeToken.IsDisposed.Should().BeTrue();
 }