Show / Hide Table of Contents

Interface IResourceAgent

Interface for the Resource Agent String resource substitution management.

Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Resource Agent", "Interface for the Resource Agent. String resource substitution management.")]
public interface IResourceAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
   using (ResourceAgent agent = new ResourceAgent())
   {
      // call methods on agent here...
   }
}

Methods

ActivateResourceSubstitutionAsync(string, string, bool, CancellationToken)

Activate or deactive a resource substitution for one or more cultures

Declaration
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
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
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
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
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
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
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
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
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
Returns
Type Description
Task

This method has no return value

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top