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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

sql - Duplicate Column name error while executing mysql query? -