/// <summary> /// Shutdown the repository /// </summary> /// <remarks> /// <para> /// Shutdown the repository. Can be overridden in a subclass. /// This base class implementation notifies the <see cref="E:log4net.Repository.LoggerRepositorySkeleton.ShutdownEvent" /> /// listeners and all attached plugins of the shutdown event. /// </para> /// </remarks> public virtual void Shutdown() { PluginCollection.IPluginCollectionEnumerator enumerator = PluginMap.AllPlugins.GetEnumerator(); try { while (enumerator.MoveNext()) { enumerator.Current.Shutdown(); } } finally { (enumerator as IDisposable)?.Dispose(); } OnShutdown(null); }
public virtual void Shutdown() { PluginCollection.IPluginCollectionEnumerator enumerator = this.PluginMap.AllPlugins.GetEnumerator(); try { while (enumerator.MoveNext()) { enumerator.Current.Shutdown(); } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } this.OnShutdown(null); }