November Happy Hour will be moved to Thursday December 5th.

Class UserTimeZone

Represents an user time zone used for the date-time auto-calculation.

Inheritance
System.Object
System.TimeZone
UserTimeZone
Implements
System.IComparable<System.TimeZone>
System.IComparable
System.Runtime.Serialization.IDeserializationCallback
Inherited Members
System.TimeZone.IsDaylightSavingTime(System.DateTime)
System.TimeZone.IsDaylightSavingTime(System.DateTime, System.Globalization.DaylightTime)
System.TimeZone.CurrentTimeZone
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.BusinessFoundation.Data
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 12.17.2
Syntax
public sealed class UserTimeZone : TimeZone, IComparable<TimeZone>, IComparable, IDeserializationCallback

Constructors

UserTimeZone(String, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)

Initializes a new instance of the UserTimeZone class.

Declaration
public UserTimeZone(string name, int bias, int daylightBias, int daylightMonth, int daylightDayOfWeek, int daylightDay, int daylightHour, int standardBias, int standardMonth, int standardDayOfWeek, int standardDay, int standardHour)
Parameters
Type Name Description
System.String name

The name.

System.Int32 bias

The bias.

System.Int32 daylightBias

The daylight bias.

System.Int32 daylightMonth

The daylight month.

System.Int32 daylightDayOfWeek

The daylight day of week.

System.Int32 daylightDay

The daylight day.

System.Int32 daylightHour

The daylight hour.

System.Int32 standardBias

The standard bias.

System.Int32 standardMonth

The standard month.

System.Int32 standardDayOfWeek

The standard day of week.

System.Int32 standardDay

The standard day.

System.Int32 standardHour

The standard hour.

Properties

DaylightName

Gets the daylight saving time zone name.

Declaration
public override string DaylightName { get; }
Property Value
Type Description
System.String
Overrides
System.TimeZone.DaylightName

Description

Gets or sets the description.

Declaration
public string Description { get; set; }
Property Value
Type Description
System.String

The description.

DisplayName

Gets or sets the display name.

Declaration
public string DisplayName { get; set; }
Property Value
Type Description
System.String

The display name.

Name

Gets the standard time zone name.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

StandardName

Gets the standard time zone name.

Declaration
public override string StandardName { get; }
Property Value
Type Description
System.String
Overrides
System.TimeZone.StandardName

WindowsTimeZones

Gets the collection of registered time zones.

Declaration
public static WindowsTimeZoneCollection WindowsTimeZones { get; }
Property Value
Type Description
WindowsTimeZoneCollection

Methods

CompareTo(Object)

Compares the current instance with another object of the same type.

Declaration
public int CompareTo(object obj)
Parameters
Type Name Description
System.Object obj

An object to compare with this instance.

Returns
Type Description
System.Int32

A 32-bit integer that indicates the relative order of the entities being compared.

Exceptions
Type Condition
System.ArgumentException

obj is not the same type as this instance.

Equals(Object)

Determines whether the specified System.Object is equal to the current System.Object.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The System.Object to compare with the current System.Object.

Returns
Type Description
System.Boolean

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

Overrides
System.Object.Equals(System.Object)
Exceptions
Type Condition
System.NullReferenceException

The obj parameter is null.

GetDaylightChanges(Int32)

Returns the daylight saving time period for a particular year.

Declaration
public override DaylightTime GetDaylightChanges(int year)
Parameters
Type Name Description
System.Int32 year

The year to which the daylight saving time period applies.

Returns
Type Description
System.Globalization.DaylightTime

A System.Globalization.DaylightTime instance containing the start and end date for daylight saving time in year.

Overrides
System.TimeZone.GetDaylightChanges(System.Int32)
Exceptions
Type Condition
System.ArgumentOutOfRangeException

year is less than 1 or greater than 9999.

GetHashCode()

Serves as a hash function for a particular type.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code for the current System.Object.

Overrides
System.Object.GetHashCode()

GetUtcOffset(DateTime)

Returns the coordinated universal time (UTC) offset for the specified local time.

Declaration
public override TimeSpan GetUtcOffset(DateTime time)
Parameters
Type Name Description
System.DateTime time

The local date and time.

Returns
Type Description
System.TimeSpan

The UTC offset from time, measured in ticks.

Overrides
System.TimeZone.GetUtcOffset(System.DateTime)

LoadFromRegistry(String, RegistryKey)

Initializes a new instance of the UserTimeZone class.

Declaration
public static UserTimeZone LoadFromRegistry(string name, RegistryKey data)
Parameters
Type Name Description
System.String name

The name of the time zone as recorded in the Windows registry.

Microsoft.Win32.RegistryKey data

The time zone's registry data.

Returns
Type Description
UserTimeZone

ToLocalTime(DateTime)

Returns the local time that corresponds to a specified coordinated universal time (UTC).

Declaration
public override DateTime ToLocalTime(DateTime time)
Parameters
Type Name Description
System.DateTime time

A UTC time.

Returns
Type Description
System.DateTime

A System.DateTime instance whose value is the local time that corresponds to time.

Overrides
System.TimeZone.ToLocalTime(System.DateTime)

ToString()

Returns a System.String representing the time zone.

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

ToUniversalTime(DateTime)

Returns the coordinated universal time (UTC) that corresponds to a specified local time.

Declaration
public override DateTime ToUniversalTime(DateTime time)
Parameters
Type Name Description
System.DateTime time

The local date and time.

Returns
Type Description
System.DateTime

A System.DateTime instance whose value is the UTC time that corresponds to time.

Overrides
System.TimeZone.ToUniversalTime(System.DateTime)

UpdateNames(String, String)

Updates the display names.

Declaration
public void UpdateNames(string standartName, string daylightName)
Parameters
Type Name Description
System.String standartName

Name of the standart.

System.String daylightName

Name of the daylight.

Operators

Equality(UserTimeZone, UserTimeZone)

Implements the operator ==.

Declaration
public static bool operator ==(UserTimeZone t1, UserTimeZone t2)
Parameters
Type Name Description
UserTimeZone t1

The t1.

UserTimeZone t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

GreaterThan(UserTimeZone, UserTimeZone)

Implements the operator >.

Declaration
public static bool operator>(UserTimeZone t1, UserTimeZone t2)
Parameters
Type Name Description
UserTimeZone t1

The t1.

UserTimeZone t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

Inequality(UserTimeZone, UserTimeZone)

Implements the operator !=.

Declaration
public static bool operator !=(UserTimeZone t1, UserTimeZone t2)
Parameters
Type Name Description
UserTimeZone t1

The t1.

UserTimeZone t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

LessThan(UserTimeZone, UserTimeZone)

Implements the operator <.

Declaration
public static bool operator <(UserTimeZone t1, UserTimeZone t2)
Parameters
Type Name Description
UserTimeZone t1

The t1.

UserTimeZone t2

The t2.

Returns
Type Description
System.Boolean

The result of the operator.

Explicit Interface Implementations

IComparable<TimeZone>.CompareTo(TimeZone)

Compares the current object with another object of the same type.

Declaration
int IComparable<TimeZone>.CompareTo(TimeZone other)
Parameters
Type Name Description
System.TimeZone other

An object to compare with this object.

Returns
Type Description
System.Int32

A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the other parameter.Zero This object is equal to other. Greater than zero This object is greater than other.

IDeserializationCallback.OnDeserialization(Object)

Initializes the non-serialized members.

Declaration
void IDeserializationCallback.OnDeserialization(object sender)
Parameters
Type Name Description
System.Object sender

The object that initiated the callback. The functionality for this parameter is not currently implemented.

Implements

System.IComparable<T>
System.IComparable
System.Runtime.Serialization.IDeserializationCallback