comparison Implab/Components/App.cs @ 192:f1da3afc3521 release v2.1

Слияние с v2
author cin
date Fri, 22 Apr 2016 13:10:34 +0300
parents b933ec88446e
children
comparison
equal deleted inserted replaced
71:1714fd8678ef 192:f1da3afc3521
1 using System;
2 using System.Collections.Generic;
3
4 namespace Implab.Components {
5 /// <summary>
6 /// Global application components and services.
7 /// </summary>
8 public static class App {
9 readonly static ComponentContainer<object> _root = new ComponentContainer<object>();
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>
16 public static ICollection<object> RootContainer {
17 get { return _root; }
18 }
19
20 static App() {
21 AppDomain.CurrentDomain.DomainUnload += (sender, e) => _root.Dispose();
22 }
23 }
24 }
25