Class ResourceAgent
Proxy class for the Resource 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 ResourceAgent : IResourceAgent, IAgent
Constructors
ResourceAgent(IResourceOverrideImplementation, ISoRequestItemsAccessor)
Proxy class for the Resource Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public ResourceAgent(IResourceOverrideImplementation resourceOverrideImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IResourceOverrideImplementation | resourceOverrideImplementation | |
ISoRequestItemsAccessor | accessor |
ResourceAgent(IResourceOverrideImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository)
Proxy class for the Resource Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public ResourceAgent(IResourceOverrideImplementation resourceOverrideImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository)
Parameters
Type | Name | Description |
---|---|---|
IResourceOverrideImplementation | resourceOverrideImplementation | |
ISoRequestItemsAccessor | accessor | |
IDebugUser | debugUser | |
IServiceCallsRepository | serviceCallsRepository |
Methods
ActivateResourceSubstitutionAsync(string, string, bool, CancellationToken)
Activate or deactive a resource substitution for one or more cultures
Declaration
public Task ActivateResourceSubstitutionAsync(string resourceName, string culture, bool isActive, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | resourceName | The name of the resource, without any brackets; if blank then this is the MASTER SWITCH for the override system |
string | culture | The .NET culture string; if blank, then ALL substitutions for this resource will be affected |
bool | isActive | New status of override |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
DeleteResourceSubstitutionAsync(string, string, CancellationToken)
Permanentely delete a resource substitution for one or more cultures
Declaration
public Task DeleteResourceSubstitutionAsync(string resourceName, string culture, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | resourceName | The name of the resource, without any brackets |
string | culture | The .NET culture string; if blank, then ALL substitutions for this resource will be dropped |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |
GetResourceSubstitutionsAsync(string[], string, bool, CancellationToken)
Get substitutions for some or all resources for one culture
Declaration
public Task<ResourceOverride[]> GetResourceSubstitutionsAsync(string[] resourceNames, string culture, bool activeOnly, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string[] | resourceNames | Array of names of resources for which overrides are sought; if empty, then get all |
string | culture | .NET culture string; if empty, then get all |
bool | activeOnly | If true, then only resources with active substitutions will be returned; if false then ALL existing overrides will be returned |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<ResourceOverride[]> | Array of override objects, empty if there are none |
IsResourceSubstitutionActiveAsync(string[], string, CancellationToken)
Determine if resource substitution/override is active, globally or for a subset of resources/cultures
Declaration
public Task<ResourceOverride[]> IsResourceSubstitutionActiveAsync(string[] resourceNames, string culture, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string[] | resourceNames | Array of names of resources for which overrides are sought; if empty, then get the MASTER on/off |
string | culture | .NET culture string; if empty, then get for all cultures (unless resourceName |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<ResourceOverride[]> | Array of override objects, empty if there are none; the ResourceValue member is not set by this call |
SetResourceSubstitutionAsync(string, string, string, bool, CancellationToken)
Create or update a resource substitution
Declaration
public Task SetResourceSubstitutionAsync(string resourceName, string resourceValues, string culture, bool isActive, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | resourceName | The name of the resource, without any brackets |
string | resourceValues | The new value of the resource |
string | culture | The .NET culture string |
bool | isActive | Is the subsitution now active |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task | This method has no return value |