main
 1using System;
 2
 3namespace Gorilla.Commons.Infrastructure.Container
 4{
 5    static public class Resolve
 6    {
 7        static DependencyRegistry underlying_registry;
 8
 9        static public void initialize_with(DependencyRegistry registry)
10        {
11            underlying_registry = registry;
12        }
13
14        static public DependencyToResolve the<DependencyToResolve>()
15        {
16            try
17            {
18                return underlying_registry.get_a<DependencyToResolve>();
19            }
20            catch (Exception e)
21            {
22                throw new DependencyResolutionException<DependencyToResolve>(e);
23            }
24        }
25
26        static public bool is_initialized()
27        {
28            return underlying_registry != null;
29        }
30    }
31}