Question

I there any way to instantiate TimeSpan struct in Spring .NET configuration?

My Config looks like this:

<object  id="historize_production_control" type="BB.VisCtrl.Process.ImageIndexer.ProcessLogic.HistorizeAndCleanProductionControl,BB.VisCtrl.Process.ImageIndexer">
    <constructor-arg name="inspectionToKeep" value="6"></constructor-arg>
    <constructor-arg name="destationDir" value=".\"></constructor-arg>
    <constructor-arg name="resourceCleaner" ref="file_cleaner"></constructor-arg>
<constructor-arg name="cleanHistoryResourcesAfter" value="6d {TimeSpan here }"></constructor-arg>
<constructor-arg name="cleanResourcesAfter" ref="6d {TimeSpan here }" ></constructor-arg>
</object>

Thanks for answers.

Was it helpful?

Solution

If I correctly understood, you want something like that:

<object id="RefTimeSpan" type="System.TimeSpan">
    <constructor-arg name="days" value="6" />
    <constructor-arg name="hours" value="0" />
    <constructor-arg name="minutes" value="0" />
    <constructor-arg name="seconds" value="0" />
</object>
<constructor-arg name="cleanHistoryResourcesAfter" ref="RefTimeSpan" />
<constructor-arg name="cleanResourcesAfter" ref="RefTimeSpan" />

OTHER TIPS

Use this

 <constructor-arg name="cleanResourcesAfter" type="System.TimeSpan" value="6.00:00:00" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top