Joutsen v0.5.0+12-g5dd5f7e
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | Events | List of all members
Joutsen.Progress Class Reference

This class can be used to inform various listeners about the progress of a process. More...

Public Member Functions

 Progress (double total)
 Creates a new instance for a predefined total value. More...
 
virtual void Update (double completed)
 Advances the progress to the value represented by @paramref completed. More...
 
virtual void Reset ()
 Resets the progress state for a restart. More...
 
void Dispose ()
 Frees bound resources. More...
 

Protected Member Functions

void FireProgressChanged (double completed, double total, double progress)
 Informs the registered listeners about a change in progress. More...
 
void FireDescriptionChanged (string description)
 Informs the registered listeners about a change in the description. More...
 

Protected Attributes

double total
 The total value that the process can reach. More...
 
double completed
 The completed amount or current progress. More...
 
String description
 The description of progress. More...
 

Properties

String Description [get, set]
 The description of progress. More...
 

Events

Action< double, double, double > ProgressChanged
 An event that informs listeners about a change in the progress. More...
 
Action< String > DescriptionChanged
 An event that informs listeners about a change in the description. More...
 

Detailed Description

This class can be used to inform various listeners about the progress of a process.

Remarks
This class is designed to raise events only in case of real changes. Do not rely on it informing listeners if progress stays the same. This is especially important for the 100% case which will only be reported once.
Since
0.4.1

Constructor & Destructor Documentation

◆ Progress()

Joutsen.Progress.Progress ( double  total)

Creates a new instance for a predefined total value.

Exceptions
ArgumentOutOfBoundsExceptionif total is smaller then zero

Member Function Documentation

◆ Dispose()

void Joutsen.Progress.Dispose ( )

Frees bound resources.

◆ FireDescriptionChanged()

void Joutsen.Progress.FireDescriptionChanged ( string  description)
protected

Informs the registered listeners about a change in the description.

Parameters
descriptionthe new description

◆ FireProgressChanged()

void Joutsen.Progress.FireProgressChanged ( double  completed,
double  total,
double  progress 
)
protected

Informs the registered listeners about a change in progress.

Parameters
progressthe percentage of completion

◆ Reset()

virtual void Joutsen.Progress.Reset ( )
virtual

Resets the progress state for a restart.

◆ Update()

virtual void Joutsen.Progress.Update ( double  completed)
virtual

Advances the progress to the value represented by @paramref completed.

Parameters
completedthe current state of progress represented by a part of the total

Member Data Documentation

◆ completed

double Joutsen.Progress.completed
protected

The completed amount or current progress.

◆ description

String Joutsen.Progress.description
protected

The description of progress.

◆ total

double Joutsen.Progress.total
protected

The total value that the process can reach.

This value represents 100%.

Property Documentation

◆ Description

String Joutsen.Progress.Description
getset

The description of progress.

This is often used to describe the current step in the progress.

Event Documentation

◆ DescriptionChanged

Action<String> Joutsen.Progress.DescriptionChanged

An event that informs listeners about a change in the description.

◆ ProgressChanged

Action<double,double,double> Joutsen.Progress.ProgressChanged

An event that informs listeners about a change in the progress.

Remarks
The reported values represent the completed part, the total and the percentage of completion.