Class TimeZoneManager
Inheritance
TimeZoneManager
Assembly: SoDataBase.dll
Syntax
public class TimeZoneManager
Constructors
TimeZoneManager()
Declaration
Methods
CheckNewTimeZoneDataAvailableAsync(CancellationToken)
Declaration
public static Task<bool> CheckNewTimeZoneDataAvailableAsync(CancellationToken cancellationToken = default)
Parameters
Returns
DeleteTimeZonesAsync(CancellationToken)
Declaration
public static Task DeleteTimeZonesAsync(CancellationToken cancellationToken)
Parameters
Returns
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
Returns
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
Returns
InitializeTimeZoneData()
Initalizes the TimeZoneData
Declaration
public static TimeZoneData[] InitializeTimeZoneData()
Returns
SetActiveTimeZoneRowAsync(int, bool, CancellationToken)
Declaration
public static Task SetActiveTimeZoneRowAsync(int id, bool active, CancellationToken cancellationToken)
Parameters
Returns
SetActiveTimeZonesByFilterAsync(string, bool, CancellationToken)
Declaration
public static Task SetActiveTimeZonesByFilterAsync(string filter, bool active, CancellationToken cancellationToken)
Parameters
Returns
SetBaseTimeZoneIdAsync(int, CancellationToken)
Declaration
public static Task<bool> SetBaseTimeZoneIdAsync(int timeZoneId, CancellationToken cancellationToken)
Parameters
Returns
TimeOfLastTimeZoneUpdateAsync(CancellationToken)
Declaration
public static Task<DateTime> TimeOfLastTimeZoneUpdateAsync(CancellationToken cancellationToken = default)
Parameters
Returns
ToggleActiveTimeZoneRowAsync(int, CancellationToken)
Declaration
public static Task ToggleActiveTimeZoneRowAsync(int id, CancellationToken cancellationToken)
Parameters
Returns
UpdateTimeZoneDataAsync(CancellationToken)
Declaration
public static Task<bool> UpdateTimeZoneDataAsync(CancellationToken cancellationToken = default)
Parameters
Returns
Extension Methods