Tuesday, 15 September 2015

c# - how to and where setup Castle Windsor v2.5 for MVP Winforms properly -



c# - how to and where setup Castle Windsor v2.5 for MVP Winforms properly -

i confused proper implementation of castle windsor winforms scenarios, doc had found wcf , asp.net mvc inquire help proper implementation of castle windsor in windows forms. here code... begin approach of mvp http://dotnetchris.wordpress.com/2009/02/16/creating-a-generic-model-view-presenter-framework/

pasing winforms made

public interface ipresenter<tviewmodel> { tviewmodel view { get; set; } event eventhandler viewinitialized; void onviewinitialized(eventargs e); event eventhandler viewloaded; void onviewloaded(eventargs e); }

and base of operations form

public partial class mvpform<tpresenter, tviewmodel> : form tpresenter : ipresenter<tviewmodel> tviewmodel : class

following first part presenter is

public class patientsearchcreatepresenter: ipresenter<ipatientfilterviewmodel> { ipatientbusinessservice patient; /// <summary> /// initializes new instance of <see cref="patientfilterpresenter" /> class. /// </summary> public patientsearchcreatepresenter(ipatientbusinessservice patient) { patient = patient; }

and form search , create patients this

public partial class formsearchcreatepatient : mvpform<patientsearchcreatepresenter,ipatientsearchcreateviewmodel> , ipatientsearchcreateviewmodel {

where , how should perform installation & registration of castle component view, , presenter service property

thank much

here's how did sometime ago:

public class businesscontainer : windsorcontainer { public businesscontainer() { registercomponents(); } private void registercomponents() { // presenters addcomponentwithlifestyle("helloworld.presenter", typeof(helloworldpresenter), lifestyletype.transient); } } }

since inclusion of ioc container little bit complex, finish step step, take here.

c# .net winforms dependency-injection castle-windsor

No comments:

Post a Comment