I've had luck with creating timestamps using the format "HH:MM:SS" in
the component parameter configuration, but I've never tried that
approach. Do you need to have a separate component for the timespan?
You could put the value in a property if it's reused.
On Mon, Oct 13, 2008 at 4:07 PM, George Mauer <[EMAIL PROTECTED]> wrote:
>
> I have a variety of classes in my project that take a TimeSpan in the
> constructor which is to be provided from a settings class. So as an
> example, I have things wired as follows
>
> <component id="timed_alert_dialog"
>
> service="DriverInterface2.UI.Presentation.UIInterfaces.ITimedDialog,
> DriverInterface2.UI.Presentation"
> type="DriverInterface2.UI.WinForms.Dialogs.AlertDialog,
> DriverInterface2.UI.WinForms">
> <parameters><timespan>${time_alert_dialogs_remain_on_screen}</
> timespan></parameters>
> </component>
>
> <component id="time_alert_dialogs_remain_on_screen"
> type="System.TimeSpan"
> factoryId="global_settings"
> factoryCreate="get_TimeAlertDialogsRemainOnScreen" />
>
> But when I try to resolve timed_alert_dialog I get the following
> error:
> {"Could not convert from '${time_alert_dialogs_remain_on_screen}' to
> System.TimeSpan"}
> Inner Exception: {"Input string was not in a correct format."}
>
> Some things I have learned while experimenting:
> I can resolve time_alert_dialogs_remain_on_screen (the TimeSpan)
> properly with no problem.
> If I change the constructor to take an object that is later cast to a
> TimeSpan then it works fine also.
>
> This last point indicates an annoying yet quick way to resolve the
> situation which is for obvious reasons, less than ideal. What is the
> cause of the problem and is there any way I can resolve it for real?
>
> Thanks a lot,
> George Mauer
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---