I have an object with two parameters that needs to be created via Spring.NET using the configuration file for decoupling.
public Object(string param1, string param2) { ... }
The two parameters are dynamically passed in based on user interaction where they pass in a username and password, so these values can't be hard coded to the configuration file. Therefore the following will not work:
<object name="WinFormApplicationWorkflow" type="COM.Us.Workflow.ApplicationWorkflow, "COM.Us.Workflow ">
<!-- this will NOT work -->
<constructor-arg index="0" value="TESTUSER"></constructor-arg>
<constructor-arg index="1" value="TESTPW"></constructor-arg>
<!-- / -->
<property name="NetworkWorkflow" ref="NetworkWorkflow" />
<property name="ExceptionLogger" ref="ExceptionLogger" />
</object>
How can I do this with Spring.NET, so that I can just do:
ContextRegister.GetContext().GetObject("WinFormApplicationWorkflow");
But still pass in the two necessary parameters to my workflow class.
Thanks!