Пример #1
0
        /// <inheritdoc/>
        public IBindingScopeBuilder To(Func <BindingContext, object> callback)
        {
            _binding = new Binding(
                _binding.Service,
                new Strategies.CallbackWithBindingContext(callback),
                _binding.Scope);

            _scopeBuilder = new BindingScopeBuilder(_binding);
            return(_scopeBuilder);
        }
Пример #2
0
        /// <inheritdoc/>
        public IBindingScopeBuilder To(object constant)
        {
            _binding = new Binding(
                _binding.Service,
                new Strategies.Constant(constant),
                _binding.Scope);

            _scopeBuilder = new BindingScopeBuilder(_binding);
            return(_scopeBuilder);
        }
Пример #3
0
        /// <inheritdoc/>
        public IBindingScopeBuilder To(Func <Type> callback)
        {
            _binding = new Binding(
                _binding.Service,
                new Strategies.TypeCallback(callback),
                _binding.Scope);

            _scopeBuilder = new BindingScopeBuilder(_binding);
            return(_scopeBuilder);
        }
Пример #4
0
        /// <inheritdoc/>
        public IBindingScopeBuilder To(Type type)
        {
            _binding = new Binding(
                _binding.Service,
                new Strategies.Type(type),
                _binding.Scope);

            _scopeBuilder = new BindingScopeBuilder(_binding);
            return(_scopeBuilder);
        }
Пример #5
0
        /// <inheritdoc/>
        public IBindingScopeBuilder To(Func <Type> callback)
        {
            Binding = new Binding(
                Binding.Service,
                new Strategies.TypeCallback(callback),
                Binding.Scope);

            ScopeBuilder = new BindingScopeBuilder(Binding);
            return(ScopeBuilder);
        }
Пример #6
0
        /// <inheritdoc/>
        public IBindingScopeBuilder To(object constant)
        {
            Binding = new Binding(
                Binding.Service,
                new Strategies.Constant(constant),
                Binding.Scope);

            ScopeBuilder = new BindingScopeBuilder(Binding);
            return(ScopeBuilder);
        }
Пример #7
0
        /// <inheritdoc/>
        public IBindingScopeBuilder To(Type type)
        {
            Binding = new Binding(
                Binding.Service,
                new Strategies.Type(type),
                Binding.Scope);

            ScopeBuilder = new BindingScopeBuilder(Binding);
            return(ScopeBuilder);
        }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of <see cref="BindingBuilder"/>
 /// </summary>
 /// <param name="binding"><see cref="Binding"/> to build from</param>
 public BindingBuilder(Binding binding)
 {
     _binding      = binding;
     _scopeBuilder = new BindingScopeBuilder(binding);
 }