Click or drag to resize

TimeZoneFactory Class

Creates IdtTimeZone classes as required by the running application.
Inheritance Hierarchy
SystemObject
  InnerDrive.TimeZonesTimeZoneFactory

Namespace: InnerDrive.TimeZones
Assembly: InnerDrive.TimeZones (in InnerDrive.TimeZones.dll) Version: 5.0.8475.0
Syntax
C#
public sealed class TimeZoneFactory : IDisposable, 
	ITimeZoneFactory

The TimeZoneFactory type exposes the following members.

Constructors
 NameDescription
Public methodTimeZoneFactory Creates a new instance of TimeZoneFactory.
Top
Properties
 NameDescription
Public propertyCount Gets the number of time zone rules currently loaded in the TimeZoneFactory.
Public propertyInitialized Gets or sets an indication of whether the TimeZoneFactory has been initialized.
Public propertyThrowOnFailure If True (default), causes the class to throw an exception if the data cannot be parsed.
Public propertyZoneNames Gets the list of zone names that the TimeZoneFactory has knowledge of.
Top
Methods
 NameDescription
Public methodClear Clears the cache of all time zone information.
Public methodContains Gets an indication of whether the TimeZoneFactory contains a specific IdtTimeZone.
Public methodDefaultTimeZone Gets the default time zone for the application
Public methodDispose Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Finalizer. Releases resources.
(Overrides ObjectFinalize)
Public methodFind Gets a IdtTimeZone from the cache.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInitialize Initializes the factory
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Fields
 NameDescription
Public fieldStatic memberDefaultTimeZoneNameSettingKey Gets the name of the application setting containing the name of the default time zone to use in the application.
Public fieldStatic memberDummyChangeRuleName Gets the symbol indicating that a TimeChangeRule is not required to determine how a TimeZoneRule works for a particular date range.
Public fieldStatic memberThrowOnFailureSettingKey Gets the name of the application setting containing an indication of the default ThrowOnFailure behavior.
Top
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"
  }
}
See Also