Ejemplo n.º 1
0
 public SingleBindingSyntax(IImplementationResolver resolver)
 {
     _binding = new SingleBinding
     {
         Service  = typeof(TImpl),
         Resolver = resolver
     };
 }
        public static void Register(IWindsorContainer container, SingleBinding binding)
        {
            ComponentRegistration<object> registration = Component.For(binding.Service);

            registration = ApplyResolver(registration, (dynamic) binding.Resolver);

            registration = ApplyLifecycle(registration, binding.Lifecycle);

            registration = ApplyName(registration, binding.Name);

            container.Register(registration);
        }
Ejemplo n.º 3
0
        public static void Register(IWindsorContainer container, SingleBinding binding)
        {
            ComponentRegistration <object> registration = Component.For(binding.Service);

            registration = ApplyResolver(registration, (dynamic)binding.Resolver);

            registration = ApplyLifestyle(registration, binding.Lifestyle);

            registration = ApplyName(registration, binding.Name);

            container.Register(registration);
        }
        public static void Register(global::StructureMap.IContainer container, SingleBinding binding)
        {
            container.Configure(ce =>
                {
                    var registration = ce.For(binding.Service);

                    registration = ApplyLifestyleSingle(registration, binding.Lifestyle);

                    var unnamed = ApplyResolver(registration, (dynamic)binding.Resolver);

                    ApplyName(unnamed, binding.Name);
                });
        }
        public static void Register(global::StructureMap.IContainer container, SingleBinding binding)
        {
            container.Configure(ce =>
            {
                var registration = ce.For(binding.Service);

                registration = ApplyLifestyleSingle(registration, binding.Lifestyle);

                var unnamed = ApplyResolver(registration, binding.Resolver);

                ApplyName(unnamed, binding.Name);
            });
        }
        public static void Register(global::Autofac.IContainer container, SingleBinding binding)
        {
            var builder = new ContainerBuilder();

            IRegistrationBuilder<object, IConcreteActivatorData, SingleRegistrationStyle> registration = ApplyResolver(builder, (dynamic)binding.Resolver);

            registration = registration.As(binding.Service).PreserveExistingDefaults();

            registration = ApplyLifestyleSingle(registration, binding.Lifestyle);

            ApplyName(registration, binding.Name, binding.Service);

            builder.Update(container);
        }
Ejemplo n.º 7
0
 public static void EmulateMultiBinding(this IServiceProvider serviceProvider, Binding multiBinding, IList <BindingBase> bindings)
 {
     if (bindings.Count > 1)
     {
         MultipleBindings.Emulate(serviceProvider, multiBinding, bindings);
     }
     else if (bindings.Count == 1)
     {
         SingleBinding.Emulate(multiBinding, bindings [0]);
     }
     else
     {
         NoBindings.Emulate(multiBinding);
     }
 }
Ejemplo n.º 8
0
		public ImageTextCell (string imageProperty, string textProperty)
			: this()
		{
			ImageBinding = new PropertyBinding(imageProperty);
			TextBinding = new PropertyBinding(textProperty);
		}
Ejemplo n.º 9
0
		public ImageTextCell (int imageColumn, int textColumn)
			: this()
		{
			ImageBinding = new ColumnBinding(imageColumn);
			TextBinding = new ColumnBinding(textColumn);
		}