winforms - Castle Windsor - Register all Windows Forms -


this way how autofac

var assembly = assembly.getexecutingassembly(); builder.registerassemblytypes(assembly)     .where(type => type.issubclassof(typeof(form))); 

or

var assembly = assembly.getexecutingassembly(); builder.registerassemblytypes(assembly)     .assignableto<form>(); 

how castle windsor ?

something should work (typing memory):

container.register(    classes.fromassembly(assembly.getexecutingassembly())       .basedon<form>()       .configure(c => c.lifestyle.transient) ); 

the configure option isn't required, win forms transient.

check out registration docs more options.


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -