NanoByte.Common  2.6.1
NanoByte.Common.Tasks.CliTaskHandler Class Reference

Uses the console (stderr stream) to inform the user about the progress of tasks and ask questions. More...

Inheritance diagram for NanoByte.Common.Tasks.CliTaskHandler:
NanoByte.Common.Tasks.TaskHandlerBase NanoByte.Common.MarshalNoTimeout NanoByte.Common.Tasks.ITaskHandler

Public Member Functions

override void Dispose ()
 
override void RunTask (ITask task)
 Runs an ITask and tracks its progress. Returns once the task has been completed. The task may be executed on a different thread.
 
override bool Ask (string question, bool? defaultAnswer=null, string? alternateMessage=null)
 Asks the user a Yes/No/Cancel question.
 
override void Output (string title, string message)
 Displays multi-line text to the user.
 
override void Error (Exception exception)
 Displays an error message to the user.
 
- Public Member Functions inherited from NanoByte.Common.Tasks.TaskHandlerBase
virtual void Output< T > (string title, IEnumerable< T > data)
 Displays tabular data to the user.
 
virtual void Output< T > (string title, NamedCollection< T > data)
 Displays tree-like data to the user.
 
- Public Member Functions inherited from NanoByte.Common.MarshalNoTimeout
override? object InitializeLifetimeService ()
 

Protected Member Functions

override void LogHandler (LogSeverity severity, string message)
 Prints Log messages to the Console based on their LogSeverity and the current Verbosity level. More...
 
- Protected Member Functions inherited from NanoByte.Common.Tasks.TaskHandlerBase
 TaskHandlerBase ()
 Starts handling log events. More...
 

Properties

override? ICredentialProvider CredentialProvider [get]
 
- Properties inherited from NanoByte.Common.Tasks.TaskHandlerBase
CancellationToken CancellationToken [get]
 
abstract ? ICredentialProvider CredentialProvider [get]
 
Verbosity Verbosity [get, set]
 
- Properties inherited from NanoByte.Common.Tasks.ITaskHandler
CancellationToken CancellationToken [get]
 Used to signal when the user wishes to cancel the entire current process (and any ITasks it includes). More...
 
ICredentialProviderCredentialProvider [get]
 Used to ask the user or a keyring for NetworkCredentials for specific Uris; can be null. More...
 
Verbosity Verbosity [get, set]
 The detail level of messages displayed to the user. More...
 

Additional Inherited Members

- Protected Attributes inherited from NanoByte.Common.Tasks.TaskHandlerBase
readonly CancellationTokenSource CancellationTokenSource = new()
 Used to signal the CancellationToken. More...
 

Detailed Description

Uses the console (stderr stream) to inform the user about the progress of tasks and ask questions.

Member Function Documentation

◆ LogHandler()

override void NanoByte.Common.Tasks.CliTaskHandler.LogHandler ( LogSeverity  severity,
string  message 
)
inlineprotectedvirtual

Prints Log messages to the Console based on their LogSeverity and the current Verbosity level.

Parameters
severityThe type/severity of the entry.
messageThe message text of the entry.

Implements NanoByte.Common.Tasks.TaskHandlerBase.


The documentation for this class was generated from the following file: