Class ServerTaskParameter
The base class for any parameter that can work against a IServerTask and be processed by a ITaskProcessor
Any implementation can be refernced from the ParameterType, or can be marked with a ServerTaskParametersAttribute to detail what task type these parameters are for
Any implementation of this can have 3 constructors that the system will automatically use for creation in order:- (IBaseEntity item, IEntityUpdater context): Creates default parameters using this constructor for the specified item and a context.
- (IBaseEntity item): Creates default parameters using this constructor for the soecified item.
- (): Creates default parameters using this constructor.
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.API.Tasks
Assembly: API.dll
Syntax
[DataContract]
public abstract class ServerTaskParameter : SerializedParam, ICloneable
Properties
AllowAutoCreateOnLockedItems
By default items implementing ICanBeLocked will return false for ShouldAutomaticallyCreateTask(IHasSaveProcessingTask, IEntityUpdater) if they are locked
If this is true, then they can return true for creating a task
Declaration
protected virtual bool AllowAutoCreateOnLockedItems { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AllowSaveWithNoChangesForTaskCreation(IHasSaveProcessingTask)
Indicates that the system allows the save command in the UI to be activated to create a task for this item even when there are no changes in the context.
In other words the user can view this item and hit save to create its associated task without making any changes. By default this is false, and tasks are only created in conjunction with changes to items to process them
Declaration
public virtual bool AllowSaveWithNoChangesForTaskCreation(IHasSaveProcessingTask item)
Parameters
Type | Name | Description |
---|---|---|
IHasSaveProcessingTask | item | The item to check if it should allow the save command in the UI to be activated without any changes |
Returns
Type | Description |
---|---|
System.Boolean | True if the system allows the save command in the UI to be activated to create a task for this item even when there are no changes in the context. False by default. |
DisplayUserParamOnSave(IHasSaveProcessingTask)
Indicates when this item is being saved from the client UI that the system should display the parameters for the task being created for user modification
This allows the automatic integration of save popups with parameters relating to the item being saved
Declaration
public virtual bool DisplayUserParamOnSave(IHasSaveProcessingTask item)
Parameters
Type | Name | Description |
---|---|---|
IHasSaveProcessingTask | item | The item being saved from the client UI |
Returns
Type | Description |
---|---|
System.Boolean | True (the default) if the specified item should have the parameters for the task it automatically creates displayed to the user during the save |
GetUserFriendlyTaskInstanceIdentityInfo(IServerTask)
Returns a user friendly string for the type of task being processed that these parameters work against
Declaration
public abstract string GetUserFriendlyTaskInstanceIdentityInfo(IServerTask task)
Parameters
Type | Name | Description |
---|---|---|
IServerTask | task | An instance of a task that these parameters work for |
Returns
Type | Description |
---|---|
System.String | A user friendly string for the type of task being processed that these parameters work against |
ShouldAutomaticallyCreateTask(IHasSaveProcessingTask, IEntityUpdater)
Returns true if the specified item should automatically have a task created against it for processing when being saved
By default returns true unless if the item implements ICanBeLocked and is locked.
The behaviour can be overridden by this method, or by implementing theitem
implementation of GetShouldAutoGenerateTaskOnSave()
Declaration
public virtual bool ShouldAutomaticallyCreateTask(IHasSaveProcessingTask item, IEntityUpdater context)
Parameters
Type | Name | Description |
---|---|---|
IHasSaveProcessingTask | item | The item that can have tasks automatically created against them to process changes when they are saved |
IEntityUpdater | context | The current context the item is being changed and saved within |
Returns
Type | Description |
---|---|
System.Boolean | True if the specified item should automatically have a task created against it for processing when being saved |