Noda Time
IDateTimeZoneSource Interface
NamespacesNodaTime.TimeZonesIDateTimeZoneSource

[This is preliminary documentation and is subject to change.]

Provides the interface for objects that can retrieve time zone definitions given an ID.
Declaration Syntax
C#Visual BasicVisual C++
public interface IDateTimeZoneSource
Public Interface IDateTimeZoneSource
public interface class IDateTimeZoneSource
Members
All MembersMethodsProperties



IconMemberDescription
ForId(String)
Returns the time zone definition associated with the given ID.

GetIds()()()()
Returns an unordered enumeration of the IDs available from this source.

MapTimeZoneId(TimeZoneInfo)
Returns this source's corresponding ID for the given BCL time zone.

VersionId
Returns an appropriate version ID for diagnostic purposes, which must not be null. This doesn't have any specific format; it's solely for diagnostic purposes. The included sources return strings of the format "source identifier: source version" indicating where the information comes from and which version of the source information has been loaded.

Remarks

The interface presumes that the available time zones are static; there is no mechanism for updating the list of available time zones. Any time zone ID that is returned in GetIds()()()() must be resolved by ForId(String) for the life of the source.

Implementations need not cache time zones or the available time zone IDs. Caching is typically provided by DateTimeZoneCache, which most consumers should use instead of consuming IDateTimeZoneSource directly in order to get better performance.

It is expected that any exceptions thrown are implementation-specific; nothing is explicitly specified in the interface. Typically this would be unusual to the point that callers would not try to catch them; any implementation which may break in ways that are sensible to catch should advertise this clearly, so that clients will know to handle the exceptions appropriately. No wrapper exception type is provided by Noda Time to handle this situation, and code in Noda Time does not try to catch such exceptions.

Thread Safety
Implementations are not required to be thread-safe.

Assembly: NodaTime (Module: NodaTime.dll) Version: 1.2.0.0 (1.2.0)