Exemplo n.º 1
0
        public IBinding AddReference(BindingId id)
        {
            var binding = _binder.BindReference <TAbstraction>(id).InList();

            _bindings.Add(binding);
            return(binding);
        }
Exemplo n.º 2
0
        BindingId IBinding.Id()
        {
            if (Id != null)
            {
                throw new InvalidOperationException("Already specified Id or Alias.");
            }

            Id = new BindingId(this);
            return(Id);
        }
Exemplo n.º 3
0
        IBinding IBinding.Id(BindingId id)
        {
            if (Id != null)
            {
                throw new InvalidOperationException("Already specified Id or Alias.");
            }

            Id         = id;
            id.Binding = this;
            return(this);
        }
Exemplo n.º 4
0
        public IBinding BindReference(Type abstractionType, BindingId id)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            var binding = new Binding(this, abstractionType, id);

            _bindings.Add(binding);
            return(binding);
        }
Exemplo n.º 5
0
 public Binding(IContainer container, Type abstractionType, BindingId reference)
 {
     Container       = container;
     AbstractionType = abstractionType;
     Reference       = reference;
 }
Exemplo n.º 6
0
 public IBinding BindReference(Type sourceAbstractionType, BindingId id) => Binding.Null;
Exemplo n.º 7
0
 public IBinding BindReference(Type sourceAbstractionType, BindingId id) =>
 _overrideContainer.BindReference(sourceAbstractionType, id);
Exemplo n.º 8
0
 public IBinding Id(BindingId id)
 {
     throw new NotSupportedException("Cannot associate an Id with NullBinding");
 }
Exemplo n.º 9
0
 public static IBinding BindReference <TSourceAbstraction>(this IBinder This, BindingId id) =>
 This.BindReference(typeof(TSourceAbstraction), id);