예제 #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();
        }
예제 #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();
        }
예제 #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));
 }
예제 #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));
 }
예제 #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));
 }