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.Core.Tasks
Assembly: LemonEdge.API.dll
Syntax
[DataContract]
public abstract class ServerTaskParameter : SerializedParam, ICloneable
Constructors
ServerTaskParameter()
Declaration
protected ServerTaskParameter()
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 |
---|---|
bool |
Methods
AllowSaveWithNoChangesForTaskCreation(IHasSaveProcessingTask, IEntityUpdater)
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, IEntityUpdater context)
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 |
IEntityUpdater | context |
Returns
Type | Description |
---|---|
bool | 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, IEntityUpdater)
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, IEntityUpdater context)
Parameters
Type | Name | Description |
---|---|---|
IHasSaveProcessingTask | item | The item being saved from the client UI |
IEntityUpdater | context |
Returns
Type | Description |
---|---|
bool | 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 |
---|---|
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 |
---|---|
bool | True if the specified item should automatically have a task created against it for processing when being saved |