Ejemplo n.º 1
0
        public DefaultBindToInScopeWithDescendantFilterOrUniqueOrNamed(StandardKernel kernel, DefaultMapping defaultMapping)
        {
            _kernel  = kernel;
            _mapping = defaultMapping;

            // This makes the most sense by default; when using ToFactory
            // it gets set to false implicitly.
            _mapping.UniquePerScope = true;
        }
Ejemplo n.º 2
0
        public IBindToInScopeWithDescendantFilterOrUniqueOrNamed Bind(Type @interface)
        {
            List <IMapping> list;

            if (!_bindings.ContainsKey(@interface))
            {
                list = new List <IMapping>();
                _bindings[@interface] = list;
            }
            else
            {
                list = _bindings[@interface];
            }
            var mapping = new DefaultMapping();

            mapping.Target = @interface;
            list.Add(mapping);
            return(new DefaultBindToInScopeWithDescendantFilterOrUniqueOrNamed(this, mapping));
        }
Ejemplo n.º 3
0
        public IBindToInScopeWithDescendantFilterOrUniqueOrNamed <TInterface> Bind <TInterface>()
        {
            List <IMapping> list;

            if (!_bindings.ContainsKey(typeof(TInterface)))
            {
                list = new List <IMapping>();
                _bindings[typeof(TInterface)] = list;
            }
            else
            {
                list = _bindings[typeof(TInterface)];
            }
            var mapping = new DefaultMapping();

            mapping.Target = typeof(TInterface);
            list.Add(mapping);
            return(new DefaultBindToInScopeWithDescendantFilterOrUnique <TInterface>(this, mapping));
        }
Ejemplo n.º 4
0
 public DefaultBindToInScopeWithDescendantFilterOrUnique(StandardKernel kernel, DefaultMapping defaultMapping) : base(kernel, defaultMapping)
 {
 }