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
shortThe 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
IsEmpty
Gets a value indicating whether the index is empty.
public readonly bool IsEmpty { get; }
Property Value
Second
Gets the second time zone index.
public readonly short Second { get; }
Property Value
Methods
Add(short)
Adds a time zone index to the structure.
public bool Add(short index)
Parameters
index
shortThe 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
objectThe 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
TimeZoneIndexThe 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
TimeZoneIndexThe first TimeZoneIndex to compare.
right
TimeZoneIndexThe 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
TimeZoneIndexThe first TimeZoneIndex to compare.
right
TimeZoneIndexThe second TimeZoneIndex to compare.
Returns
- bool
true if the two TimeZoneIndex instances are not equal; otherwise, false.