C# Class Kamsar.WebConsole.SubtaskProgressStatus

An implementation of IProgressStatus designed to be used as a "subtask" within a parent IProgressStatus. This encapsulates the idea of task progress, e.g. the method receiving this progress object need only be concerned with its own 1-100% progress, not the overall progress of all tasks. The total progress of the console is scaled proprotionally to the number of total tasks provided.
Inheritance: IProgressStatus, IDisposable
Afficher le fichier Open project: kamsar/Kamsar.WebConsole Class Usage Examples

Méthodes publiques

Méthode Description
Dispose ( ) : void
Report ( int percent ) : void
Report ( int percent, string statusMessage ) : void
Report ( int percent, string statusMessage, MessageType type ) : void
ReportException ( Exception exception ) : void
ReportStatus ( string statusMessage ) : void
ReportStatus ( string statusMessage, MessageType type ) : void
ReportTransientStatus ( string statusMessage ) : void
SubtaskProgressStatus ( string taskName, IProgressStatus mainTask, int subtaskIndex, int subtaskCount ) : System

Default constructor. Automatically manages transient status for you.

SubtaskProgressStatus ( string taskName, IProgressStatus mainTask, int subtaskIndex, int subtaskCount, bool automaticTransientStatus ) : System

Default constructor

Private Methods

Méthode Description
InitializeStatus ( ) : void
SetProgress ( int taskProgress ) : void
SetRangeTaskProgress ( int startPercentage, int endPercentage, int taskPercent ) : void

Sets the progress of the whole based on the progress within a percentage range of the main progress (e.g. 0-100% of a task within the global range of 0-20%)

SetTaskProgress ( int taskNumber, int totalTasks, int taskPercent ) : void

Sets the progress of the whole based on the progress within a sub-task of the main progress (e.g. 0-100% of a task within the global range of 0-20%)

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Report() public méthode

public Report ( int percent ) : void
percent int
Résultat void

Report() public méthode

public Report ( int percent, string statusMessage ) : void
percent int
statusMessage string
Résultat void

Report() public méthode

public Report ( int percent, string statusMessage, MessageType type ) : void
percent int
statusMessage string
type MessageType
Résultat void

ReportException() public méthode

public ReportException ( Exception exception ) : void
exception System.Exception
Résultat void

ReportStatus() public méthode

public ReportStatus ( string statusMessage ) : void
statusMessage string
Résultat void

ReportStatus() public méthode

public ReportStatus ( string statusMessage, MessageType type ) : void
statusMessage string
type MessageType
Résultat void

ReportTransientStatus() public méthode

public ReportTransientStatus ( string statusMessage ) : void
statusMessage string
Résultat void

SubtaskProgressStatus() public méthode

Default constructor. Automatically manages transient status for you.
public SubtaskProgressStatus ( string taskName, IProgressStatus mainTask, int subtaskIndex, int subtaskCount ) : System
taskName string Name of the subtask to run
mainTask IProgressStatus The progress status of the main task (or parent subtask)
subtaskIndex int The index of this subtask among total subtask count (used to calculate offset progress)
subtaskCount int The total number of subtasks in the main task (or parent subtask)
Résultat System

SubtaskProgressStatus() public méthode

Default constructor
public SubtaskProgressStatus ( string taskName, IProgressStatus mainTask, int subtaskIndex, int subtaskCount, bool automaticTransientStatus ) : System
taskName string Name of the subtask to run
mainTask IProgressStatus The progress status of the main task (or parent subtask)
subtaskIndex int The index of this subtask among total subtask count (used to calculate offset progress)
subtaskCount int The total number of subtasks in the main task (or parent subtask)
automaticTransientStatus bool If true, transient status will be automatically managed for you for this subtask ($taskname running for xx seconds). Make sure to dispose the subtask!
Résultat System