Example #1
0
        public CryoContainer RegisterProvider <T>(IObjectProvider provider, string name = null)
        {
            var key = new ContainerKey(typeof(T), name);

            _providers[key] = provider;
            return(this);
        }
Example #2
0
        private IObjectProvider ResolveProvider(Type type, string name, out ContainerKey key)
        {
            key = new ContainerKey(type, name);
            IObjectProvider provider = null;

            _providers.TryGetValue(key, out provider);
            return(provider);
        }
Example #3
0
        public void Push(ContainerKey key, LifeTime lifetime)
        {
            _stack.Add(new Entry
            {
                Key      = key,
                LifeTime = lifetime
            });

            CheckLifeTime();
        }
 protected bool Equals(ContainerKey other)
 {
     return((Type == other.Type) && string.Equals(Name, other.Name));
 }