Class ZoneSourceBuilder
Collects the zones of a ZoneSource; Build() makes the source. Each method returns the builder.
public sealed class ZoneSourceBuilder
- Inheritance
-
ZoneSourceBuilder
- Inherited Members
Methods
AddLink(string, string)
Make name another name for the zone target.
public ZoneSourceBuilder AddLink(string name, string target)
Parameters
Returns
AddOracle(string, ZoneOracle)
Add a zone by probing oracle.
public ZoneSourceBuilder AddOracle(string name, ZoneOracle oracle)
Parameters
namestringThe name the zone is drawn by.
oracleZoneOracleThe function to probe and the years to probe it over.
Returns
AddTimeZone(TimeZoneInfo)
Add a zone that behaves as zone does, under its Id,
which is also the object a draw of that name yields. Its offsets are read from the object
the first time a draw needs them.
public ZoneSourceBuilder AddTimeZone(TimeZoneInfo zone)
Parameters
zoneTimeZoneInfoThe zone.
Returns
AddTzif(string, byte[])
Add a zone from the contents of a TZif file (RFC 9636, version 2 or later), such as one under /usr/share/zoneinfo.
public ZoneSourceBuilder AddTzif(string name, byte[] tzif)
Parameters
Returns
Build()
The source. Later calls on the builder do not change it.
public ZoneSource Build()
Returns
Exceptions
- ArgumentException
The engine rejected a zone: a malformed TZif file, a bad name, an oracle that failed.
Declare(params string[])
Name zones the source has whose data Loader(Action<string, IZoneData>)'s function supplies when a draw first needs it.
public ZoneSourceBuilder Declare(params string[] names)
Parameters
namesstring[]The names.
Returns
Loader(Action<string, IZoneData>)
Supply zone data on demand: loader is called with a name the source
declared, or one a generator was told to draw, the first time its data is needed, and adds
that zone to the IZoneData it is given, or adds nothing for a name it does not
know. It may be called from any thread, and more than once for a name. An exception it
throws fails the draw that needed the data, with the exception's message.
public ZoneSourceBuilder Loader(Action<string, IZoneData> loader)
Parameters
Returns
Version(string)
Record which release of its database the source holds, such as 2025b.
public ZoneSourceBuilder Version(string version)
Parameters
versionstringThe release.