NanoByte.Common 2.10.6
NanoByte.Common.Tasks.AnsiCliTaskHandler Class Reference

Informs the user about the progress of tasks and ask questions using ANSI console output. More...

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

Public Member Functions

override void RunTask (ITask task)
 Runs an ITask and tracks its progress. Returns once the task has been completed. More...
 
override void Dispose ()
 
override void Output (string title, string message)
 Displays multi-line text to the user. More...
 
override void Output< T > (string title, IEnumerable< T > data)
 Displays tabular data to the user. More...
 
override void Output< T > (string title, NamedCollection< T > data)
 Displays tree-like data to the user. More...
 
- Public Member Functions inherited from NanoByte.Common.Tasks.CliTaskHandler
 CliTaskHandler ()
 Creates a new CLI task handler. Registers a Log.Handler and a Console.CancelKeyPress handler.
 
override void Dispose ()
 Unregisters the Log.Handler and the Console.CancelKeyPress handler. More...
 
override void RunTask (ITask task)
 Runs an ITask and tracks its progress. Returns once the task has been completed. More...
 
override void Output (string title, string message)
 Displays multi-line text to the user. More...
 
override void Error (Exception exception)
 Displays an error message to the user. More...
 
- Public Member Functions inherited from NanoByte.Common.Tasks.TaskHandlerBase
bool Ask (string question, bool? defaultAnswer=null, string? alternateMessage=null)
 Asks the user a Yes/No/Cancel question. More...
 

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...
 
override bool AskInteractive (string question, bool defaultAnswer)
 Asks the user a Yes/No/Cancel question. More...
 
- Protected Member Functions inherited from NanoByte.Common.Tasks.CliTaskHandler
override bool AskInteractive (string question, bool defaultAnswer)
 Asks the user a Yes/No/Cancel question. More...
 

Properties

override? ICredentialProvider CredentialProvider [get]
 
- Properties inherited from NanoByte.Common.Tasks.CliTaskHandler
override? ICredentialProvider CredentialProvider [get]
 
override bool IsInteractive [get]
 
- Properties inherited from NanoByte.Common.Tasks.TaskHandlerBase
CancellationTokenSource CancellationTokenSource = new() [get]
 Used to signal the CancellationToken.
 
CancellationToken CancellationToken [get]
 
virtual ? ICredentialProvider CredentialProvider [get]
 
Verbosity Verbosity [getset]
 
virtual bool IsInteractive [get]
 Indicates whether the user can provide input.
 
- 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.
 
Verbosity Verbosity [getset]
 The detail level of messages displayed to the user.
 

Detailed Description

Informs the user about the progress of tasks and ask questions using ANSI console output.

This class is thread-safe.

Member Function Documentation

◆ AskInteractive()

override bool NanoByte.Common.Tasks.AnsiCliTaskHandler.AskInteractive ( string  question,
bool  defaultAnswer 
)
inlineprotectedvirtual

Asks the user a Yes/No/Cancel question.

Implements NanoByte.Common.Tasks.TaskHandlerBase.

◆ Dispose()

override void NanoByte.Common.Tasks.AnsiCliTaskHandler.Dispose ( )
inlinevirtual

◆ LogHandler()

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

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

Reimplemented from NanoByte.Common.Tasks.CliTaskHandler.

◆ Output()

override void NanoByte.Common.Tasks.AnsiCliTaskHandler.Output ( string  title,
string  message 
)
inlinevirtual

Displays multi-line text to the user.

Implements NanoByte.Common.Tasks.TaskHandlerBase.

◆ Output< T >() [1/2]

override void NanoByte.Common.Tasks.AnsiCliTaskHandler.Output< T > ( string  title,
IEnumerable< T >  data 
)
inlinevirtual

Displays tabular data to the user.

Reimplemented from NanoByte.Common.Tasks.TaskHandlerBase.

◆ Output< T >() [2/2]

override void NanoByte.Common.Tasks.AnsiCliTaskHandler.Output< T > ( string  title,
NamedCollection< T >  data 
)
inlinevirtual

Displays tree-like data to the user.

Reimplemented from NanoByte.Common.Tasks.TaskHandlerBase.

◆ RunTask()

override void NanoByte.Common.Tasks.AnsiCliTaskHandler.RunTask ( ITask  task)
inlinevirtual

Runs an ITask and tracks its progress. Returns once the task has been completed.

Reimplemented from NanoByte.Common.Tasks.TaskHandlerBase.


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