TimeZoneFactory Class

Creates IdtTimeZone classes as required by the running application.

Definition

Namespace: InnerDrive.TimeZones
Assembly: InnerDrive.TimeZones (in InnerDrive.TimeZones.dll) Version: 5.2.9017.0
C#
public sealed class TimeZoneFactory : IDisposable, 
	ITimeZoneFactory
Inheritance
Object    TimeZoneFactory
Implements
ITimeZoneFactory, IDisposable

Remarks

The TimeZoneFactory expects two configuration settings:
KeyDescription
timeZoneSettings:DefaultTimeZoneHomeZoneThe IANA identifier of your default time zone. Note that this time zone must be defined in the data that you read into the class.
timeZoneSettings:throwOnLoadFailure(Optional; default true) Throws an InvalidTimeZoneException if there is an error parsing time zone data

Here is a typical configuration section in appSettings.json:

C#
{
    "timeZoneSettings": {
    "defaultTimeZoneHomeZone": "America/Chicago",
    "throwOnLoadFailure": "false"
  }
}

Constructors

TimeZoneFactory Creates a new instance of TimeZoneFactory.

Properties

Count Gets the number of time zone rules currently loaded in the TimeZoneFactory.
Initialized Gets or sets an indication of whether the TimeZoneFactory has been initialized.
ThrowOnFailure If True (default), causes the class to throw an exception if the data cannot be parsed.
ZoneNames Gets the list of zone names that the TimeZoneFactory has knowledge of.

Methods

Clear Clears the cache of all time zone information.
Contains Gets an indication of whether the TimeZoneFactory contains a specific IdtTimeZone.
Dispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize Finalizer. Releases resources.
(Overrides ObjectFinalize)
FindAsync Gets a IdtTimeZone from the cache.
GetDefaultTimeZoneAsync Gets the default time zone for the application
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
InitializeAsync Initializes the factory
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

Fields

DefaultTimeZoneNameSettingKey Gets the name of the application setting containing the name of the default time zone to use in the application.
DummyChangeRuleName Gets the symbol indicating that a TimeChangeRule is not required to determine how a TimeZoneRule works for a particular date range.
ThrowOnFailureSettingKey Gets the name of the application setting containing an indication of the default ThrowOnFailure behavior.

See Also