Show / Hide Table of Contents

Class TimeZoneManager

Inheritance
object
TimeZoneManager
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.TimeZone
Assembly: SoDataBase.dll
Syntax
public class TimeZoneManager

Constructors

TimeZoneManager()

Declaration
public TimeZoneManager()

Methods

CheckNewTimeZoneDataAvailableAsync(CancellationToken)

Declaration
public static Task<bool> CheckNewTimeZoneDataAvailableAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

DeleteTimeZonesAsync(CancellationToken)

Declaration
public static Task DeleteTimeZonesAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task

GetBaseTimeZoneId()

Get the base timezone id.

Declaration
public static int GetBaseTimeZoneId()
Returns
Type Description
int

Returns the base timezone id. Returns 0 if not set.

GetDefaultTimeZonePreferenceAsync(CancellationToken)

Declaration
public static Task<int> GetDefaultTimeZonePreferenceAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<int>

GetEffectiveDefaultTimeZoneAsync(CancellationToken)

Resolve the effective default time zone for the current user, walking the preference levels from Individual down to HardDefault and returning the first row with a non-empty value. Rows with NULL/empty values are skipped: clearing the personal time zone in user preferences leaves an empty individual-level row behind, and that row must not shadow a time zone set at a higher level (e.g. system-wide). When no level has a value, falls back to the base time zone code with UserPreferenceId 0. Resolves for the current principal (CurrentPrincipal), not an arbitrary user. Callers must guard the returned code against null/empty before passing it to GetTimeZoneDataByCode(string) — the fallback code is null when time zones are not initialized.

Declaration
public static Task<(string TzCode, int UserPreferenceId)> GetEffectiveDefaultTimeZoneAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<(string, int)>

InitializeTimeZoneData()

Initalizes the TimeZoneData

Declaration
public static TimeZoneData[] InitializeTimeZoneData()
Returns
Type Description
TimeZoneData[]

SetActiveTimeZoneRowAsync(int, bool, CancellationToken)

Declaration
public static Task SetActiveTimeZoneRowAsync(int id, bool active, CancellationToken cancellationToken)
Parameters
Type Name Description
int id
bool active
CancellationToken cancellationToken
Returns
Type Description
Task

SetActiveTimeZonesByFilterAsync(string, bool, CancellationToken)

Declaration
public static Task SetActiveTimeZonesByFilterAsync(string filter, bool active, CancellationToken cancellationToken)
Parameters
Type Name Description
string filter
bool active
CancellationToken cancellationToken
Returns
Type Description
Task

SetBaseTimeZoneIdAsync(int, CancellationToken)

Declaration
public static Task<bool> SetBaseTimeZoneIdAsync(int timeZoneId, CancellationToken cancellationToken)
Parameters
Type Name Description
int timeZoneId
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

TimeOfLastTimeZoneUpdateAsync(CancellationToken)

Declaration
public static Task<DateTime> TimeOfLastTimeZoneUpdateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<DateTime>

ToggleActiveTimeZoneRowAsync(int, CancellationToken)

Declaration
public static Task ToggleActiveTimeZoneRowAsync(int id, CancellationToken cancellationToken)
Parameters
Type Name Description
int id
CancellationToken cancellationToken
Returns
Type Description
Task

UpdateTimeZoneDataAsync(CancellationToken)

Declaration
public static Task<bool> UpdateTimeZoneDataAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top