NanoByte.Common  2.8.1
NanoByte.Common.Tasks Namespace Reference

Manage long-running tasks and track their progress. More...

Classes

struct  CancellationToken
 Propagates notification that operations should be canceled. More...
 
struct  CancellationTokenRegistration
 Represents a callback delegate that has been registered with a CancellationToken. More...
 
class  CancellationTokenSource
 Signals to CancellationTokens that they should be canceled. More...
 
class  CliProgress
 Reports task progress updates using console output. More...
 
class  CliTaskHandler
 Informs the user about the progress of tasks and ask questions using console output. More...
 
class  ForEachTask
 A task that performs an operation once for each element of a collection. More...
 
interface  ITask
 Represents an operation that can be cancelled and have its progress tracked. More...
 
interface  ITaskHandler
 Used to execute and track ITasks and ask the user questions. Specific implementations provide different kinds of user interfaces. More...
 
class  Progress
 Reports progress updates using callbacks/events. Performs the callbacks using the synchronization context of the original caller. More...
 
class  ServiceTaskHandler
 Uses ILogger<TCategoryName>, ICredentialProvider and CancellationTokenSource from

See also
IServiceProvider

if available. Executes tasks silently and suppresses any questions. More...

 
class  SilentTaskHandler
 Executes tasks silently and suppresses any questions. More...
 
class  SimplePercentTask
 A delegate-driven task. Progress is reported in percent. More...
 
class  SimpleTask
 A delegate-driven task. Only completion is reported, no intermediate progress. More...
 
class  SynchronousProgress
 Reports progress updates using callbacks/events. Performs the callbacks immediately on the same thread. More...
 
class  TaskBase
 Abstract base class for ITask implementations. More...
 
class  TaskHandlerBase
 Common base class for ITaskHandler implementations. More...
 
class  TaskHandlerExtensions
 Extension methods for ITaskHandler More...
 
struct  TaskSnapshot
 Represents a progress snapshot of an ITask. More...
 
class  WaitTask
 Waits for a WaitHandle to become available. More...
 
class  AnsiCliProgress
 Reports task progress updates using ANSI console output. More...
 
class  AnsiCliProgressContext
 Container for one or more ANSI console progress bars. More...
 
class  AnsiCliTaskHandler
 Informs the user about the progress of tasks and ask questions using ANSI console output. More...
 
class  DialogTaskHandler
 Uses simple WinForms dialog boxes to inform the user about the progress of tasks. More...
 
class  GuiTaskHandlerBase
 Common base class for WinForms ITaskHandler implementations. More...
 
class  TaskRunDialog
 A dialog with a progress bar that runs and tracks the progress of an ITask. More...
 

Enumerations

enum class  TaskState {
  Ready , Started , Header , Data ,
  Complete , WebError , IOError , Canceled
}
 Represents different states a (usually Web- or IO-related) task can be in. More...
 
enum class  Verbosity { Batch = -1 , Normal = 0 , Verbose = 1 , Debug = 2 }
 
See also
ITaskHandler.Verbosity
More...
 

Functions

delegate void PercentProgressCallback (int percent)
 A callback to be called by a workload to report its progress in percent. More...
 

Detailed Description

Manage long-running tasks and track their progress.

Enumeration Type Documentation

◆ TaskState

Represents different states a (usually Web- or IO-related) task can be in.

See also
TaskSnapshot.State
Enumerator
Ready 

The task is ready to begin.

Started 

The task has just been started.

Header 

Handling the header.

Data 

Handling the actual data.

Complete 

The task has been completed successfully.

WebError 

An error occurred during the task.

IOError 

An error occurred while writing the file.

Canceled 

The task was canceled by the user before completion.

◆ Verbosity

See also
ITaskHandler.Verbosity

Enumerator
Batch 

Automatically answer questions with defaults when possible. Avoid non-essential output and questions.

Normal 

Normal interactive operation.

Verbose 

Display additional information for troubleshooting.

Debug 

Display detailed information for debugging.

Function Documentation

◆ PercentProgressCallback()

delegate void NanoByte.Common.Tasks.PercentProgressCallback ( int  percent)

A callback to be called by a workload to report its progress in percent.

Parameters
percentThe workload's progress in percent.