Click or drag to resize
IWebFarmServiceRegisterTask Method (Type, Boolean, WebFarmTaskOptimizeActionEnum)
Registers a new web farm task type to allow its processing within the system. The type must inherit WebFarmTaskBase.

Namespace: CMS.Core
Assembly: CMS.Core (in CMS.Core.dll) Version: 13.0.131
Syntax
C#
void RegisterTask(
	Type taskType,
	bool isMemoryTask = false,
	WebFarmTaskOptimizeActionEnum webFarmTaskOptimize = WebFarmTaskOptimizeActionEnum.None
)

Parameters

taskType
Type: SystemType
The type of task to register.
isMemoryTask (Optional)
Type: SystemBoolean
Indicates if the task modifies memory only. Memory tasks can be deleted on application start.
webFarmTaskOptimize (Optional)
Type: CMS.CoreWebFarmTaskOptimizeActionEnum
Determines type of optimization which is used for reducing number of generated web farm tasks of particular type.
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when taskType is null.
ArgumentExceptionThrown when taskType does not inherit WebFarmTaskBase or does not have parameterless constructor.
InvalidOperationExceptionThrown when task with type taskType has been already registered.
See Also