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

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

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -