Class TaskProgressReporter
Inherited Members
Namespace: LemonEdge.Connections.Database.Tasks
Assembly: LemonEdge.Database.Connector.dll
Syntax
public class TaskProgressReporter : IProgressReporter, IDisposable
Constructors
TaskProgressReporter(IDataAccessor, UserInfo, IReadOnlyCache, Guid?, Action<string>, Guid, string, IEntityCreator, IEntityContextFactory)
Declaration
public TaskProgressReporter(IDataAccessor accessor, UserInfo user, IReadOnlyCache cache, Guid? canvasID, Action<string> writeLine, Guid taskID, string taskDescription, IEntityCreator entityCreator, IEntityContextFactory entityContextFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| IDataAccessor | accessor | |
| UserInfo | user | |
| IReadOnlyCache | cache | |
| Guid? | canvasID | |
| Action<string> | writeLine | |
| Guid | taskID | |
| string | taskDescription | |
| IEntityCreator | entityCreator | |
| IEntityContextFactory | entityContextFactory |
Fields
MAX_TIME_TICKS_FOR_DBSAVE
Declaration
public static TimeSpan MAX_TIME_TICKS_FOR_DBSAVE
Field Value
| Type | Description |
|---|---|
| TimeSpan |
MINIMUM_PROGRESS_INC_FOR_DBSAVE
Declaration
public static decimal MINIMUM_PROGRESS_INC_FOR_DBSAVE
Field Value
| Type | Description |
|---|---|
| decimal |
Methods
Dispose()
Declaration
public void Dispose()
Dispose(bool)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
FlushAllPendingMessages()
Writes all pending messages in the progress reporter
Declaration
public Task FlushAllPendingMessages()
Returns
| Type | Description |
|---|---|
| Task | A task that indicates when the operation is complete |
ReportError(Exception)
Reports an error encountered at the current percentage progress
Declaration
public void ReportError(Exception ex)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | ex | The exception encountered during the operation |
ReportMessage(string)
Reports a message for the current progress
Declaration
public void ReportMessage(string message)
Parameters
| Type | Name | Description |
|---|---|---|
| string | message | The message to display |
ReportProgress(decimal, string)
Reports the percentage progress on the current overall operation with a specific message
Declaration
public void ReportProgress(decimal progressPercent, string message = "")
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | progressPercent | The current progress of the overall operation |
| string | message | The message for the current progress |
ReportProgressHeader(string)
Reports the overall header for the current progress state
Declaration
public void ReportProgressHeader(string msg)
Parameters
| Type | Name | Description |
|---|---|---|
| string | msg | The header for the current state of progress |
ReportProgressWithForceSave(decimal, string)
Reports the percentage progress on the current overall operation with a specific message
Declaration
public void ReportProgressWithForceSave(decimal progressPercent, string message = "")
Parameters
| Type | Name | Description |
|---|---|---|
| decimal | progressPercent | The current progress of the overall operation |
| string | message | The message for the current progress |
ReportSubProgress(short, decimal, string)
Reports the percentage progress for the current sub task of the overall operation with a specific
message
Declaration
public void ReportSubProgress(short subProgressIndex, decimal progressPercent, string message = "")
Parameters
| Type | Name | Description |
|---|---|---|
| short | subProgressIndex | The index of the current sub task. Sub tasks should start at 1 and increment for each sub task. |
| decimal | progressPercent | The progress of the current sub task |
| string | message | The message for the current progress of the sub task |