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
ActivateResourceSubstitution(String, String, Boolean)
Activate or deactive a resource substitution for one or more cultures
Declaration
void ActivateResourceSubstitution(string resourceName, string culture, bool isActive)
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 |
Boolean | isActive | New status of override |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ResourceAgent agent = new ResourceAgent())
{
// call methods on agent here...
}
}
DeleteResourceSubstitution(String, String)
Permanentely delete a resource substitution for one or more cultures
Declaration
void DeleteResourceSubstitution(string resourceName, string culture)
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 |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ResourceAgent agent = new ResourceAgent())
{
// call methods on agent here...
}
}
GetResourceSubstitutions(String[], String, Boolean)
Get substitutions for some or all resources for one culture
Declaration
ResourceOverride[] GetResourceSubstitutions(string[] resourceNames, string culture, bool activeOnly)
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 |
Boolean | activeOnly | If true, then only resources with active substitutions will be returned; if false then ALL existing overrides will be returned |
Returns
Type | Description |
---|---|
ResourceOverride[] | Array of override objects, empty if there are none |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ResourceAgent agent = new ResourceAgent())
{
// call methods on agent here...
}
}
IsResourceSubstitutionActive(String[], String)
Determine if resource substitution/override is active, globally or for a subset of resources/cultures
Declaration
ResourceOverride[] IsResourceSubstitutionActive(string[] resourceNames, string culture)
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 |
Returns
Type | Description |
---|---|
ResourceOverride[] | Array of override objects, empty if there are none; the ResourceValue member is not set by this call |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ResourceAgent agent = new ResourceAgent())
{
// call methods on agent here...
}
}
SetResourceSubstitution(String, String, String, Boolean)
Create or update a resource substitution
Declaration
void SetResourceSubstitution(string resourceName, string resourceValues, string culture, bool isActive)
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 |
Boolean | isActive | Is the subsitution now active |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (ResourceAgent agent = new ResourceAgent())
{
// call methods on agent here...
}
}