Ejemplo n.º 1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Binding" /> class.
        /// </summary>
        /// <param name="service">The service that is controlled by the binding.</param>
        public Binding(Type service)
        {
            Ensure.ArgumentNotNull(service, "service");

            Service = service;
            BindingConfiguration = new BindingConfiguration();
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Binding" /> class.
        /// </summary>
        /// <param name="service">The service that is controlled by the binding.</param>
        public Binding(Type service)
        {
            Ensure.ArgumentNotNull(service, "service");

            Service = service;
            BindingConfiguration = new BindingConfiguration();
        }
Ejemplo n.º 3
0
 /// <summary>
 ///     Gets the scope for the binding, if any.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <returns>
 ///     The object that will act as the scope, or <see langword="null" /> if the service is transient.
 /// </returns>
 public object GetScope(IContext context)
 {
     return(BindingConfiguration.GetScope(context));
 }
Ejemplo n.º 4
0
 /// <summary>
 ///     Determines whether the specified request satisfies the condition defined on the binding,
 ///     if one was defined.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <returns>
 ///     <c>True</c> if the request satisfies the condition; otherwise <c>false</c>.
 /// </returns>
 public bool Matches(IRequest request)
 {
     return(BindingConfiguration.Matches(request));
 }
Ejemplo n.º 5
0
 /// <summary>
 ///     Gets the provider for the binding.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <returns>The provider to use.</returns>
 public IProvider GetProvider(IContext context)
 {
     return(BindingConfiguration.GetProvider(context));
 }