Class ProgressHelper
A helper class for tracking progress of an operation.
Inheritance
Namespace: SigStat.Common.Helpers
Assembly: SigStat.Common.dll
Syntax
public class ProgressHelper : IDisposableConstructors
| Improve this Doc View SourceProgressHelper()
Initializes an instance of ProgressHelper
Declaration
protected ProgressHelper()Properties
| Improve this Doc View SourceElapsed
Gets the total elapsed time measured by the current instance.
Declaration
public TimeSpan Elapsed { get; }Property Value
| Type | Description | 
|---|---|
| TimeSpan | 
Eta
Gets the estimated time of completion assuming linear progress.
Declaration
public DateTime Eta { get; }Property Value
| Type | Description | 
|---|---|
| DateTime | 
Maximum
The total number of individual items to be processed.
Declaration
public int Maximum { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Remaining
Gets the estimated remaining time till completion assuming linear progress.
Declaration
public TimeSpan Remaining { get; }Property Value
| Type | Description | 
|---|---|
| TimeSpan | 
ReportIntervallSeconds
If larger than 0, ReportProgress event will be executed periodically after ReportIntervallSeconds when the Value property changes.
Declaration
public int ReportIntervallSeconds { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Value
The actual number of processed items.
Declaration
public int Value { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Int32 | 
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()StartNew(Int32, Int32, Action<ProgressHelper>)
Initializes an instance of ProgressHelper with the given parameters. Make sure to manually set the Value property during operation.
Declaration
public static ProgressHelper StartNew(int maximum, int reportIntervallSeconds = 0, Action<ProgressHelper> reportProgress = null)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Int32 | maximum | The total number of individual items to be processed. | 
| System.Int32 | reportIntervallSeconds | If larger than 0, ReportProgress event will be executed periodically after ReportIntervallSeconds when the Value property changes. | 
| Action<ProgressHelper> | reportProgress | 
Returns
| Type | Description | 
|---|---|
| ProgressHelper | 
Events
| Improve this Doc View SourceReportProgress
Event will be executed periodically after ReportIntervallSeconds when the Value property changes.
Declaration
public event Action<ProgressHelper> ReportProgressEvent Type
| Type | Description | 
|---|---|
| Action<ProgressHelper> | 
Remarks
If ReportIntervallSeconds is set to 0, this event will be suppressed