It seems I can load a System.TimeZoneInfo value into an UltraTimeZoneEditor. However, the editor stores the value as it's own version of TimeZoneInfo, and there doesn't seem to be a clear way to map back.
Infragistics.Win.TimeZoneInfo has a StandardName property to uniquely identify the zone, and System.TimeZoneInfo has an Id property. But unfortunately (and goodness knows why!) these do not always match.
So is it possible to get back to the System.TimeZoneInfo from the UltraTimeZoneEditor? I'd just rather use the standard .Net object around the application than having to use the Infragistics one, otherwise it means adding extra DLLs to apps that shouldn't require them.
Thanks.
System.TimeZoneInfo has a StandardName property as well that it pulls from the registry just like the UltraTimeZoneEditor. If you take a look at the snippet in this thread, you might get a few ideas of how to use to map it in either direction.
By the way, if you look up the documentation for System.TimeZoneInfo on MSDN it states that the Id property and StandardName will usually be identical, but not always.
Thanks for replying, however, that doesn't really help. The System.TimeZoneInfo.StandardName property is still not the same as Infragistics.Win.TimeZoneInfo.StandardName in all cases (e.g. for UTC, System is "UTC" whereas Infragistics is "Coordinated Universal Time").
So am I correct in thinking there's no definitive way to get the System.TimeZoneInfo from either the UltraTimeZoneEditor or the Infragistics.Win.TimeZoneInfo class?
Run the attached program I put together this morning. It'll compare System.TimeZoneInfo vs Infragistics.Win.TimeZoneInfo. It checked out on XP & Win 7. Both those classes should be pulling from the same place in the registry.
If you happen to get the lists not equal, let me know what OS and version of the controls you're using.
Ok, thanks, that proved a point! :)
I now fall back and iterate thru the zones and match on standardname if the id lookup fails.
Cheers!