New to Telerik UI for WinForms? Start a free 30-day trial

Associates a TimeZoneInfo with a label and calculates wall-clock offsets between time zones. Day-oriented Scheduler views use these wrappers for selectable and per-zone ruler configurations.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.Scheduler.dll

Syntax:

C#
public class SchedulerTimeZone : INotifyPropertyChanged

Inheritance: objectSchedulerTimeZone

Implements: INotifyPropertyChanged

Constructors

Creates a new SchedulerTimeZone.

C#
public SchedulerTimeZone(int bias, string label)
Parameters:biasint

The UTC-offset bias in minutes, using the opposite sign of the zone's UTC offset.

labelstring

A name used to prefer a matching installed time zone when several have the requested offset.

Exceptions: ArgumentException

No installed time zone has an offset matching bias.

Wraps a time-zone definition and initializes Label from its display name.

C#
public SchedulerTimeZone(TimeZoneInfo timeZone)
Parameters:timeZoneTimeZoneInfo

The time-zone definition to wrap. If null, TimeZoneInformation remains null.

Properties

Gets or sets the label associated with this time zone. Changing the label raises PropertyChanged but does not change the wrapped time-zone definition.

C#
public string Label { get; set; }

Gets the wrapped time-zone definition, or null when the instance was constructed with a null value.

C#
public TimeZoneInfo TimeZoneInformation { get; }

Methods

Compares wrapped time-zone IDs; labels do not affect equality.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with this instance.

Returns:

bool

true if obj wraps the same non-null time-zone ID; otherwise, false.

Overrides: object.Equals(object)

Returns the hash code of the wrapped time-zone definition.

C#
public override int GetHashCode()
Returns:

int

Overrides: object.GetHashCode()

Creates a list of wrappers for the system time zones returned by GetSystemTimeZones().

C#
public static List<SchedulerTimeZone> GetSchedulerTimeZones()
Returns:

List<SchedulerTimeZone>

A new list containing one SchedulerTimeZone for each system time zone.

Finds a system time zone with the requested offset, preferring one whose name or ID matches label. Offset matching uses each zone's UTC offset for Today; if no label matches, the last matching item returned by GetSystemTimeZones() is used.

C#
public static TimeZoneInfo GetSpecificTimeZone(int bias, string label)
Parameters:biasint

The UTC-offset bias in minutes, using the opposite sign of the zone's UTC offset.

labelstring

A display, daylight, standard, or ID string used to select among zones with the same offset.

Returns:

TimeZoneInfo

A matching system time zone, or null if no zone has the requested offset today.

Finds the last item returned by GetSystemTimeZones() whose UTC offset today equals the negation of bias.

C#
public static TimeZoneInfo GetSpecificTimeZone(int bias)
Parameters:biasint

The UTC-offset bias in minutes, using the opposite sign of the zone's UTC offset.

Returns:

TimeZoneInfo

The matching system time zone, or null if no zone has that offset today.

Adjusts a wall-clock time by the difference between this zone's UTC offset and the base zone's offset at that time.

C#
public virtual DateTime OffsetTime(DateTime dateTime, SchedulerTimeZone baseTimeZone)
Parameters:dateTimeDateTime

The wall-clock time whose offset is being adjusted.

baseTimeZoneSchedulerTimeZone

The time zone whose offset is subtracted from this zone's offset.

Returns:

DateTime

dateTime shifted by the difference in UTC offsets.

Raises PropertyChanged for the specified property.

C#
protected virtual void OnPropertyChanged(string propertyName)
Parameters:propertyNamestring

The name of the changed property.

Returns the wrapped time zone's display name, not the mutable Label.

C#
public override string ToString()
Returns:

string

Overrides: object.ToString()

Events

Occurs when the Label property changes.

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged