Table of Contents

Struct TimeZoneIndex

Namespace
TZFinder
Assembly
TZFinder.dll

Represents an index for time zones, supporting up to two short values.

public struct TimeZoneIndex : IEquatable<TimeZoneIndex>, IEnumerable<short>, IEnumerable
Implements
Inherited Members

Constructors

TimeZoneIndex(short)

Initializes a new instance of the TimeZoneIndex struct with the specified index.

public TimeZoneIndex(short index)

Parameters

index short

The time zone index to add.

Exceptions

ArgumentOutOfRangeException

Thrown when index is 0.

Properties

First

Gets the first time zone index.

public readonly short First { get; }

Property Value

short

IsEmpty

Gets a value indicating whether the index is empty.

public readonly bool IsEmpty { get; }

Property Value

bool

Second

Gets the second time zone index.

public readonly short Second { get; }

Property Value

short

Methods

Add(short)

Adds a time zone index to the structure.

public bool Add(short index)

Parameters

index short

The time zone index to add.

Returns

bool

true if the index was added or already present; false if the structure is full and the index is not present.

Exceptions

ArgumentOutOfRangeException

Thrown when index is less than or equal 0.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override readonly bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Equals(TimeZoneIndex)

Determines whether the specified TimeZoneIndex is equal to the current TimeZoneIndex.

public readonly bool Equals(TimeZoneIndex other)

Parameters

other TimeZoneIndex

The TimeZoneIndex to compare with the current TimeZoneIndex.

Returns

bool

true if the specified TimeZoneIndex is equal to the current TimeZoneIndex; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override readonly int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Operators

operator ==(TimeZoneIndex, TimeZoneIndex)

Determines whether two TimeZoneIndex instances are equal.

public static bool operator ==(TimeZoneIndex left, TimeZoneIndex right)

Parameters

left TimeZoneIndex

The first TimeZoneIndex to compare.

right TimeZoneIndex

The second TimeZoneIndex to compare.

Returns

bool

true if the two TimeZoneIndex instances are equal; otherwise, false.

operator !=(TimeZoneIndex, TimeZoneIndex)

Determines whether two TimeZoneIndex instances are not equal.

public static bool operator !=(TimeZoneIndex left, TimeZoneIndex right)

Parameters

left TimeZoneIndex

The first TimeZoneIndex to compare.

right TimeZoneIndex

The second TimeZoneIndex to compare.

Returns

bool

true if the two TimeZoneIndex instances are not equal; otherwise, false.