public void Dispose_MultipleTimes_Success() { CompositionHost host = CompositionHost.CreateCompositionHost(new ExportDescriptorProvider[0]); host.Dispose(); host.Dispose(); }
protected override void Dispose(bool disposing) { if (disposing) { _compositionHost.Dispose(); } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); _customToolRunner.Dispose(); CompositionHost.Dispose(); }
private void assertExportsAndDispose(MefComposer composer) { int composedCount = 0; MefComposer lastComposer = null; ComposerEventArgs <ContainerConfiguration> lastComposedEventArgs = null; composer.Composed += (s, e) => { ++composedCount; lastComposer = s as MefComposer; lastComposedEventArgs = e; }; Assert.AreSame(composer.Compose(), lastComposedEventArgs.Target); Assert.AreEqual(1, composedCount); Assert.IsNotNull(lastComposedEventArgs); Assert.IsNotNull(lastComposedEventArgs.Target); Assert.IsNotNull(lastComposer); Assert.AreSame(composer, lastComposer); CompositionHost compositionHost = lastComposedEventArgs.Target.CreateContainer(); List <IParent> parts = new List <IParent>(3); parts.AddRange(compositionHost.GetExports <IParent>()); Assert.AreEqual(3, parts.Count); Helper.AssertValidParents(parts); composer.Dispose(); Helper.AssertValidParents(parts); compositionHost.Dispose(); Helper.AssertDisposedParents(parts); }
private void Dispose(bool isDisposing) { if (isDisposing) { _compositionHost?.Dispose(); } }
/// <summary> /// Disposes the resources used by this component factory. /// </summary> /// <param name="disposing"> /// if set to <c>false</c>, this method has been called by the runtime. /// </param> protected override void DisposeResources(bool disposing) { if (disposing && _container != null) { _container.Dispose(); _container = null; } }
public void Dispose() { if (container != null) { container.Dispose(); container = null; } }
protected override void DisposeCore(bool disposing) { _serviceProvider.Dispose(); _compositionHost.Dispose(); this.LoggerFactory.Dispose(); this.Workspace.Dispose(); }
public static void Cleanup() { if (CompositionHost != null) { CompositionHost.Dispose(); CompositionHost = null; } }
public void Dispose() { foreach (var plugin in _plugins) { plugin.OnShutdown(); } _container.Dispose(); }
void UnregisterServices() { if (_host == null) { return; } _host.Dispose(); }
public void Dispose() { if (disposed) { return; } disposed = true; host.Dispose(); }
public static void Cleanup() { if (CompositionHost != null) { CompositionHost.Dispose(); CompositionHost = null; } InitialConfiguration.Clear(); }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (_host != null) { _host.Dispose(); _host = null; } _container = null; }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (_container != null) { _container.Dispose(); _container = null; } _container = null; }
private static void Dispose() { if (!IsInitialized) { return; } _container.Dispose(); _container = null; _mockedObjects = new Dictionary <string, object>(); }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { container.Dispose(); } disposedValue = true; } }
protected virtual void Dispose(bool disposing) { if (!disposing) { return; } if (_container != null) { _container.Dispose(); } }
public static void Dispose() { lock (_sync) { if (!IsInitialized) { return; } _compositionHost.Dispose(); _mocked = new Dictionary <string, object>(); } }
public void Dispose() { _compositionHost?.Dispose(); _loggerFactory?.Dispose(); _cancellationTokenSource?.Dispose(); }
public void Dispose() { _lighthandlerContainer?.Dispose(); }
public void Dispose() { _container?.Dispose(); }
public void TearDown() { _container.Dispose(); _container = null; }