Mercurial > pub > ImplabNet
view Implab/Components/App.cs @ 203:4d9830a9bbb8 v2
Added 'Fail' method to RunnableComponent which allows component to move from
Running to Failed state.
Added PollingComponent a timer based runnable component
More tests
Added FailPromise a thin class to wrap exceptions
Fixed error handling in SuccessPromise classes.
author | cin |
---|---|
date | Tue, 18 Oct 2016 17:49:54 +0300 |
parents | b933ec88446e |
children |
line wrap: on
line source
using System; using System.Collections.Generic; namespace Implab.Components { /// <summary> /// Global application components and services. /// </summary> public static class App { readonly static ComponentContainer<object> _root = new ComponentContainer<object>(); /// <summary> /// The container for application level components. /// </summary> /// <remarks>Pools of disposable objects can be placed here and they will be automatically /// disposed when application domain is unloaded.</remarks> public static ICollection<object> RootContainer { get { return _root; } } static App() { AppDomain.CurrentDomain.DomainUnload += (sender, e) => _root.Dispose(); } } }