I have the following component
public class MyTimer : IMyTimer {
public MyTimer(TimeSpan timespan){...}
}
Where timespan should be provided by the property ISettings.MyTimerFrequency.
How do I wire this up in windsor container xml? I thought I could do something like this:
<component id="settings"
service="MySample.ISettings, MySample"
type="MySample.Settings, MySample"
factoryId="settings_dao" factoryCreate="GetSettingsForInstance">
<parameters><instance_id>1</instance_id></parameters>
</component>
<component id="my_timer_frequency"
type="System.TimeSpan"
factoryId="settings" factoryCreate="MyTimerFrequency" />
<component id="my_timer"
service="MySample.IMyTimer, MySample"
type="MySample.MyTimer, MySample">
<parameters><timespan>${my_timer_frequency}</timespan></parameters>
but I am getting an error because MyTimerFrequency is a property when the factory facility expects a method.
Is there a simple resolution here? Am I approaching the whole thing the wrong way?
EDIT: There is definitely a solution, see my answer below.