Class OpenOrRefreshResultItem
A base IClientTaskResultHandler for processing IServerTask results that indicate an entity type, and item (or collection there of) have had their data changed
This handler will open, or refresh, each entity type/id specified as being part of the results of a task so the user can see those items immediately as being data this task updated
Inherited Members
Namespace: LemonEdge.Client.Core.Tasks
Assembly: LemonEdge.ClientCore.dll
Syntax
public abstract class OpenOrRefreshResultItem : IClientTaskResultHandler, ITaskResultHandler
Constructors
OpenOrRefreshResultItem()
Declaration
protected OpenOrRefreshResultItem()
Properties
Displayer
The host context this handler is executing within
Declaration
public IModelLayoutCommon Displayer { get; }
Property Value
Type | Description |
---|---|
IModelLayoutCommon |
Methods
ConvertRawResultIntoResult(ServerTaskParameter, object)
Must be implemented by a derived type to convert the raw task result into an appropriate ServerTaskResult
Declaration
protected abstract Task<ServerTaskResult> ConvertRawResultIntoResult(ServerTaskParameter parameter, object rawResult)
Parameters
Type | Name | Description |
---|---|---|
ServerTaskParameter | parameter | The parameter that was used to run the task |
object | rawResult | The raw result of running the task |
Returns
Type | Description |
---|---|
Task<ServerTaskResult> | A conversion of the raw task result into an appropriate ServerTaskResult |
GetItemToOpenOrRefresh(SerializedParam)
Should be implemented by a derived type to retrieve the entity type/id for a single item that must be opened or refreshed by this handler
You must override either the GetItemToOpenOrRefresh(SerializedParam) or the GetItemsToOpenOrRefresh(SerializedParam) method
Declaration
protected virtual (Guid TypeID, Guid ID) GetItemToOpenOrRefresh(SerializedParam resultInfo)
Parameters
Type | Name | Description |
---|---|---|
SerializedParam | resultInfo | The result of the task that this is handling |
Returns
Type | Description |
---|---|
(Guid TypeID, Guid ID) | The single entity type/id item that should be handled by this class |
GetItemsToOpenOrRefresh(IServerTask, IServerTaskData)
Returns a collection of entity type, and associated id, for each item in the specified task that should be opened from its result
Declaration
public IEnumerable<(Guid TypeID, Guid ID)> GetItemsToOpenOrRefresh(IServerTask task, IServerTaskData data)
Parameters
Type | Name | Description |
---|---|---|
IServerTask | task | The task to process the result of and return the items that should be opened or refreshed |
IServerTaskData | data |
Returns
Type | Description |
---|---|
IEnumerable<(Guid TypeID, Guid ID)> | A collection of entity type, and associated id, for each item in the specified task that should be opened from its result |
GetItemsToOpenOrRefresh(SerializedParam)
Should be implemented by a derived type to retrieve the entity type/id for all items that must be opened or refreshed by this handler
You must override either the GetItemToOpenOrRefresh(SerializedParam) or the GetItemsToOpenOrRefresh(SerializedParam) method
Declaration
protected virtual IEnumerable<(Guid TypeID, Guid ID)> GetItemsToOpenOrRefresh(SerializedParam resultInfo)
Parameters
Type | Name | Description |
---|---|---|
SerializedParam | resultInfo | The result of the task that this is handling |
Returns
Type | Description |
---|---|
IEnumerable<(Guid TypeID, Guid ID)> | All entity type/id items that should be handled by this class |
Init(IModelLayoutCommon)
Creates a new instance of this client handler
Declaration
public void Init(IModelLayoutCommon host)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | The host context this handler should execute within |
ProcessPriorToOpeningResult(SerializedParam)
Provides any inheriting implementation the chance to process the rseult before this handler will open, or refresh, the result items
Declaration
protected virtual void ProcessPriorToOpeningResult(SerializedParam param)
Parameters
Type | Name | Description |
---|---|---|
SerializedParam | param | The parameter that holds the result of the task to process |
ProcessRawResult(ITaskRunner, ServerTaskParameter, object)
Processes the raw result of a task (which maybe a ServerTaskResult itself) and returns the ServerTaskResult representing that data that should be stored against the completed IServerTask as the result
Declaration
public Task<ServerTaskResult> ProcessRawResult(ITaskRunner runner, ServerTaskParameter parameter, object result)
Parameters
Type | Name | Description |
---|---|---|
ITaskRunner | runner | The runner that executed the server task |
ServerTaskParameter | parameter | The parameter used to execute the task itself |
object | result | The raw data result returned directly from the sucessful completion of this task |
Returns
Type | Description |
---|---|
Task<ServerTaskResult> | A serverTaskResult representing the raw data returned from the task as a ServerTaskResult that can be serialized in the IServerTask.TaskResult |
ProcessResult(IServerTask, IServerTaskData)
Retrieves the collection of entity type, and associated id, for each item in the specified task that should be opened/refreshed and performs that action within the host on them
Declaration
public Task ProcessResult(IServerTask task, IServerTaskData data)
Parameters
Type | Name | Description |
---|---|---|
IServerTask | task | The task to process the result for and open/refresh the specified items |
IServerTaskData | data |
Returns
Type | Description |
---|---|
Task | A task that indicates the completion of handling the result of the specified task |