I am learning castle.windsor following the tutorial online. this is the simple sample code:
public class Form1 {
private readonly HttpServiceWatcher serviceWatcher;
private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
public Form1(HttpServiceWatcher serviceWatcher) : this()
{
this.serviceWatcher = serviceWatcher;
}
}
HttpServiceWatcher is in the xml conf file.
My question is: who is calling the constructor that has the parameter: public Form1(Http....)
?
at the program.cs i have this:
container.AddComponent("form.component",typeof(Form1));
Form1 form1 = (Form1) container["form.component"];
Application.Run(form1);