Mercurial > pub > ImplabNet
comparison Implab/Components/App.cs @ 153:b933ec88446e v2
docs
author | cin |
---|---|
date | Fri, 12 Feb 2016 00:59:29 +0300 |
parents | 240aa6994018 |
children |
comparison
equal
deleted
inserted
replaced
152:240aa6994018 | 153:b933ec88446e |
---|---|
6 /// Global application components and services. | 6 /// Global application components and services. |
7 /// </summary> | 7 /// </summary> |
8 public static class App { | 8 public static class App { |
9 readonly static ComponentContainer<object> _root = new ComponentContainer<object>(); | 9 readonly static ComponentContainer<object> _root = new ComponentContainer<object>(); |
10 | 10 |
11 /// <summary> | |
12 /// The container for application level components. | |
13 /// </summary> | |
14 /// <remarks>Pools of disposable objects can be placed here and they will be automatically | |
15 /// disposed when application domain is unloaded.</remarks> | |
11 public static ICollection<object> RootContainer { | 16 public static ICollection<object> RootContainer { |
12 get { return _root; } | 17 get { return _root; } |
13 } | 18 } |
14 | 19 |
15 static App() { | 20 static App() { |
16 AppDomain.CurrentDomain.ProcessExit += (sender, e) => _root.Dispose(); | 21 AppDomain.CurrentDomain.DomainUnload += (sender, e) => _root.Dispose(); |
17 } | 22 } |
18 } | 23 } |
19 } | 24 } |
20 | 25 |