Selects a set of types from an assembly.
Inheritance: FromDescriptor
Example #1
0
		private BasedOnDescriptor InitializeSelection(IClass classs, FromAssemblyDescriptor componentFor)
		{
			if (classs.Where != null)
			{
				return componentFor.Where(a=>classs.Where(a));
			}
			if (classs.BasedOn != null)
			{
				return componentFor.BasedOn(classs.BasedOn).WithServiceAllInterfaces();
			}
			throw new ContainerException("Implementation not allowed for component");
		}
 private void RegisterCommandHandlers(IWindsorContainer container, FromAssemblyDescriptor descriptor)
 {
     container.Register(descriptor
         .BasedOn(typeof (ICommandHandler<>))
         .WithServiceAllInterfaces()
         .WithServiceSelf()
         .Configure(c =>
         {
             c.Named($"{c.Implementation.FullName} (fallback)");
             c.IsFallback();
         }).LifestyleTransient());
 }
 public DefaultHandlerInstaller(FromAssemblyDescriptor descriptor)
 {
     if (descriptor == null) throw new ArgumentNullException(nameof(descriptor));
     _descriptor = descriptor;
 }
		/// <summary>
		/// registers all the hubs in the assembly specified by the assembly name parameter
		/// </summary>
		/// <param name="assemblyName">Name of the assembly.</param>
		public HubsInstallers(string assemblyName)
		{
			_descriptor = AllTypes.FromAssemblyNamed(assemblyName);
		}
		/// <summary>
		/// registers all the hubs in the assemblies specified by the filter
		/// </summary>
		/// <param name="filter">The filter.</param>
		public HubsInstallers(AssemblyFilter filter)
		{
			_descriptor = AllTypes.FromAssemblyInDirectory(filter);
		}
		/// <summary>
		/// registers all the hubs contained in the assembly to which the specified type belongs to
		/// </summary>
		/// <param name="typeContainedInAssembly"></param>
		public HubsInstallers(Type typeContainedInAssembly)
		{
			_descriptor = AllTypes.FromAssemblyContaining(typeContainedInAssembly);
		}
		/// <summary>
		/// registers all the hubs contained in the passed in assembly
		/// </summary>
		/// <param name="assembly">The assembly.</param>
		public HubsInstallers(Assembly assembly)
		{
			_descriptor = AllTypes.FromAssembly(assembly);
		}