Class TimeZoneAgent
Proxy class for the TimeZone Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class TimeZoneAgent : ITimeZoneAgent, IAgent
Constructors
TimeZoneAgent(IPreferredTimeZoneImplementation, IRemoteTimeZoneMethodsImplementation, ISoRequestItemsAccessor)
Proxy class for the TimeZone Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public TimeZoneAgent(IPreferredTimeZoneImplementation preferredTimeZoneImplementation, IRemoteTimeZoneMethodsImplementation remoteTimeZoneMethodsImplementation, ISoRequestItemsAccessor accessor)
Parameters
| Type | Name | Description |
|---|---|---|
| IPreferredTimeZoneImplementation | preferredTimeZoneImplementation | |
| IRemoteTimeZoneMethodsImplementation | remoteTimeZoneMethodsImplementation | |
| ISoRequestItemsAccessor | accessor |
TimeZoneAgent(IPreferredTimeZoneImplementation, IRemoteTimeZoneMethodsImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository, IScriptingConfiguration, IOnlineConfiguration)
Proxy class for the TimeZone Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public TimeZoneAgent(IPreferredTimeZoneImplementation preferredTimeZoneImplementation, IRemoteTimeZoneMethodsImplementation remoteTimeZoneMethodsImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository, ConfigFile.IScriptingConfiguration scriptingConfiguration, ConfigFile.IOnlineConfiguration onlineConfiguration)
Parameters
| Type | Name | Description |
|---|---|---|
| IPreferredTimeZoneImplementation | preferredTimeZoneImplementation | |
| IRemoteTimeZoneMethodsImplementation | remoteTimeZoneMethodsImplementation | |
| ISoRequestItemsAccessor | accessor | |
| IDebugUser | debugUser | |
| IServiceCallsRepository | serviceCallsRepository | |
| IScriptingConfiguration | scriptingConfiguration | |
| IOnlineConfiguration | onlineConfiguration |
Methods
CheckNewTimeZoneDataAvailableAsync(CancellationToken)
Check to see if new timezone data is available
Declaration
public Task<bool> CheckNewTimeZoneDataAvailableAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns true if new timezone info is found available, false otherwise |
DeleteTimeZonesAsync(CancellationToken)
Deletes all time zone data (locations and rules) from the database
Declaration
public Task DeleteTimeZonesAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
GetBaseTimeZoneIdAsync(CancellationToken)
Get the base timezone id.
Declaration
public Task<int> GetBaseTimeZoneIdAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int> | Returns the base timezone id. Returns 0 if not set. |
GetDefaultTimeZoneInformationAsync(CancellationToken)
Get information about the current, preferred timezone for the current user. If no such preference has been set, returns the correct fallback (and UserPreferenceId is 0)
Declaration
public Task<PreferredTimeZone> GetDefaultTimeZoneInformationAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<PreferredTimeZone> | Get information about the current, preferred timezone for the current user. |
GetDefaultTimeZonePreferenceAsync(CancellationToken)
Returns the id of the default timezone preference with deflevel system wide
Declaration
public Task<int> GetDefaultTimeZonePreferenceAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<int> | The id of the system wide default timezone preference |
InitializeTimeZoneDataAsync(CancellationToken)
Initalizes the TimeZoneData
Declaration
public Task<TimeZoneData[]> InitializeTimeZoneDataAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<TimeZoneData[]> |
SetActiveTimeZoneRowAsync(int, bool, CancellationToken)
Set active state of singe row in the TZLocation table
Declaration
public Task SetActiveTimeZoneRowAsync(int id, bool active, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id of row to set active state on |
| bool | active | Set active to true or false |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
SetActiveTimeZonesByFilterAsync(string, bool, CancellationToken)
Toggles active state of a single row in the TZLocation table
Declaration
public Task SetActiveTimeZonesByFilterAsync(string filter, bool active, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filter | Filter timezones |
| bool | active | Set active to true or false |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
SetBaseTimeZoneIdAsync(int, CancellationToken)
Set the base timezone id.
Declaration
public Task<bool> SetBaseTimeZoneIdAsync(int timezoneId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | timezoneId | The timezone id to save |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns true if setting of base timezone was done |
TimeOfLastTimeZoneUpdateAsync(CancellationToken)
Get the time time zone data was last updated
Declaration
public Task<DateTime> TimeOfLastTimeZoneUpdateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<DateTime> | Time of last update |
ToggleActiveTimeZoneRowAsync(int, CancellationToken)
Toggles active state of a single row in the TZLocation table
Declaration
public Task ToggleActiveTimeZoneRowAsync(int id, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Id of row to toggle active state on |
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task |
UpdateTimeZoneDataAsync(CancellationToken)
Retrieve time zone data from the SuperOffice server and update TimeZone data in the database
Declaration
public Task<bool> UpdateTimeZoneDataAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns true if the operation succeeded |