NanoByte.Common
Classes | Enumerations | Functions
NanoByte.Common.Tasks Namespace Reference

Classes for tracking the progress of background tasks. More...

Classes

class  CancellationGuard
 Ensures that a block of code running on a background thread cleanly exits before a CancellationTokenSource.Cancel() call completes. More...
 
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  CliTaskHandler
 Uses the console (stderr stream) to inform the user about the progress of tasks and ask questions. More...
 
class  DialogTaskHandler
 Uses simple WinForms dialog boxes to inform the user about the progress of tasks. More...
 
class  ForEachTask
 A task that performs an operation once for each element of a collection. More...
 
class  GuiTaskHandlerBase
 Common base class for WinForms ITaskHandler implementations. More...
 
interface  IProgress
 Defines a provider for progress updates. 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  MutexExtensions
 Provides extension methods for

See also
Mutex

. More...

 
class  Progress
 Reports progress updates using callbacks/events. Performs the callbacks using the synchronization context of the original caller. 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  TaskRunDialog
 A dialog with a progress bar that runs and tracks the progress of an ITask. More...
 
struct  TaskSnapshot
 Represents a progress snapshot of an ITask. More...
 
class  WaitTask
 Waits for a WaitHandle to become available. More...
 

Enumerations

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

Functions

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

Detailed Description

Classes for tracking the progress of background tasks.

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 unnecessary console output (e.g. progress bars).

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 ( uint  percent)

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

Parameters
percentThe workload's progress in percent.