NanoByte.Common  2.9.0
NanoByte.Common.Tasks.GuiTaskHandlerBase Class Reference

Common base class for WinForms ITaskHandler implementations. More...

Inheritance diagram for NanoByte.Common.Tasks.GuiTaskHandlerBase:
NanoByte.Common.Tasks.TaskHandlerBase NanoByte.Common.Tasks.ITaskHandler NanoByte.Common.Tasks.DialogTaskHandler

Public Member Functions

override void Dispose ()
 Unregisters the Log.Handler. More...
 
override void Output (string title, string message)
 Displays multi-line text to the user.
 
override void Output< T > (string title, IEnumerable< T > data)
 Displays tabular data to the user.
 
override void Output< T > (string title, NamedCollection< T > data)
 Displays tree-like data 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 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.
 
bool Ask (string question, bool? defaultAnswer=null, string? alternateMessage=null)
 Asks the user a Yes/No/Cancel question.
 

Protected Member Functions

 GuiTaskHandlerBase ()
 Creates a new GUI task handler. Registers a Log.Handler. More...
 
virtual void LogHandler (LogSeverity severity, string message)
 Records Log messages in an internal log 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.
 

Protected Attributes

readonly RtfBuilder LogRtf = new()
 Stores log messages formatted in RTF for visualization. More...
 

Properties

override? ICredentialProvider CredentialProvider [get]
 
override bool IsInteractive [get]
 
- Properties inherited from NanoByte.Common.Tasks.TaskHandlerBase
CancellationTokenSource CancellationTokenSource = new() [get]
 Used to signal the CancellationToken. More...
 
CancellationToken CancellationToken [get]
 
virtual ? ICredentialProvider CredentialProvider [get]
 
Verbosity Verbosity [get, set]
 
virtual bool IsInteractive [get]
 Indicates whether the user can provide input. More...
 
- 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...
 

Detailed Description

Common base class for WinForms ITaskHandler implementations.

Constructor & Destructor Documentation

◆ GuiTaskHandlerBase()

NanoByte.Common.Tasks.GuiTaskHandlerBase.GuiTaskHandlerBase ( )
inlineprotected

Creates a new GUI task handler. Registers a Log.Handler.

Member Function Documentation

◆ Dispose()

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

Unregisters the Log.Handler.

Reimplemented from NanoByte.Common.Tasks.TaskHandlerBase.

◆ LogHandler()

virtual void NanoByte.Common.Tasks.GuiTaskHandlerBase.LogHandler ( LogSeverity  severity,
string  message 
)
inlineprotectedvirtual

Records Log messages in an internal log based on their LogSeverity and the current Verbosity level.

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

Member Data Documentation

◆ LogRtf

readonly RtfBuilder NanoByte.Common.Tasks.GuiTaskHandlerBase.LogRtf = new()
protected

Stores log messages formatted in RTF for visualization.


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