Interface IWorkItem<TContext>
Defines a base for items executable by WorkQueue
Namespace: NFX.ServiceModel
Assembly: NFX.dll
Syntax
public interface IWorkItem<TContext>
where TContext : class
Type Parameters
| Name | Description |
|---|---|
| TContext |
Methods
PerformWork(TContext)
Invoked on an item to perform actual work. For example: repaint grid from changed data source, refresh file, send email etc...
Declaration
void PerformWork(TContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | context |
WorkFailed(Boolean, Exception)
Invoked when either work execution or work success method threw an exception and did not succeed
Declaration
void WorkFailed(bool workPerformed, Exception error)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | workPerformed | When true indicates that PerformWork() worked without exception but exception happened later |
| System.Exception | error | Exception instance |
WorkSucceeded()
Invoked after successfull work execution - when no exception happened
Declaration
void WorkSucceeded()