using System; using System.Collections.Generic; namespace Implab.Components { /// /// Global application components and services. /// public static class App { readonly static ComponentContainer _root = new ComponentContainer(); /// /// The container for application level components. /// /// Pools of disposable objects can be placed here and they will be automatically /// disposed when application domain is unloaded. public static ICollection RootContainer { get { return _root; } } static App() { AppDomain.CurrentDomain.DomainUnload += (sender, e) => _root.Dispose(); } } }