Class GuiTaskHandlerBase
Common base class for WinForms ITaskHandler implementations.
Implements
Inherited Members
Namespace: NanoByte.Common.Tasks
Assembly: NanoByte.Common.WinForms.dll
Syntax
public abstract class GuiTaskHandlerBase : TaskHandlerBase, ITaskHandler
Remarks
This class is thread-safe.
Constructors
GuiTaskHandlerBase()
Declaration
protected GuiTaskHandlerBase()
Fields
LogRtf
Aggregated Log entries in rich-text form.
Declaration
protected readonly RtfBuilder LogRtf
Field Value
Type | Description |
---|---|
RtfBuilder |
Properties
CredentialProvider
Used to ask the user or a keyring for NetworkCredentials for specific Uris; can be null
.
Declaration
protected override ICredentialProvider CredentialProvider { get; }
Property Value
Type | Description |
---|---|
ICredentialProvider |
Overrides
IsInteractive
Indicates whether the user can provide input.
Declaration
protected override bool IsInteractive { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
Methods
AskInteractive(String, Boolean)
Asks the user a Yes/No/Cancel question.
Declaration
protected override bool AskInteractive(string question, bool defaultAnswer)
Parameters
Type | Name | Description |
---|---|---|
String | question | The question and comprehensive information to help the user make an informed decision. |
Boolean | defaultAnswer | The default answer to preselect. |
Returns
Type | Description |
---|---|
Boolean |
|
Overrides
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | Throw if the user answered with 'Cancel'. |
DisplayLogEntry(LogSeverity, String)
Declaration
protected override void DisplayLogEntry(LogSeverity severity, string message)
Parameters
Type | Name | Description |
---|---|---|
LogSeverity | severity | |
String | message |
Overrides
Error(Exception)
Declaration
public override void Error(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception |
Overrides
GetLogColor(LogSeverity)
Determines the color to use for a log entry based on the LogSeverity.
Declaration
protected static RtfColor GetLogColor(LogSeverity severity)
Parameters
Type | Name | Description |
---|---|---|
LogSeverity | severity |
Returns
Type | Description |
---|---|
RtfColor |
Output(String, String)
Displays multi-line text to the user.
Declaration
public override void Output(string title, string message)
Parameters
Type | Name | Description |
---|---|---|
String | title | A title for the message. |
String | message | The string to display. Trailing linebreaks are appropriately handled or ignored. |
Overrides
Remarks
Implementations may close the UI as a side effect. Therefore this should be your last call on the handler.
Output<T>(String, NamedCollection<T>)
Displays tree-like data to the user.
Declaration
public override void Output<T>(string title, NamedCollection<T> data)
where T : INamed
Parameters
Type | Name | Description |
---|---|---|
String | title | A title for the data.INamed |
NamedCollection<T> | data | The data to display. |
Type Parameters
Name | Description |
---|---|
T |
Overrides
Remarks
Implementations may close the UI as a side effect. Therefore this should be your last call on the handler.
Output<T>(String, IEnumerable<T>)
Displays tabular data to the user.
Declaration
public override void Output<T>(string title, IEnumerable<T> data)
Parameters
Type | Name | Description |
---|---|---|
String | title | A title for the data. |
IEnumerable<T> | data | The data to display. |
Type Parameters
Name | Description |
---|---|
T |
Overrides
Remarks
Implementations may close the UI as a side effect. Therefore this should be your last call on the handler.