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
Mostra file Open project: kamsar/Kamsar.WebConsole Class Usage Examples

Public Methods

Method 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

Method 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 method

public Dispose ( ) : void
return void

Report() public method

public Report ( int percent ) : void
percent int
return void

Report() public method

public Report ( int percent, string statusMessage ) : void
percent int
statusMessage string
return void

Report() public method

public Report ( int percent, string statusMessage, MessageType type ) : void
percent int
statusMessage string
type MessageType
return void

ReportException() public method

public ReportException ( Exception exception ) : void
exception System.Exception
return void

ReportStatus() public method

public ReportStatus ( string statusMessage ) : void
statusMessage string
return void

ReportStatus() public method

public ReportStatus ( string statusMessage, MessageType type ) : void
statusMessage string
type MessageType
return void

ReportTransientStatus() public method

public ReportTransientStatus ( string statusMessage ) : void
statusMessage string
return void

SubtaskProgressStatus() public method

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)
return System

SubtaskProgressStatus() public method

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!
return System