Class GuiTaskHandlerBase
Common base class for WinForms ITaskHandler implementations.
[MustDisposeResource]
public abstract class GuiTaskHandlerBase : TaskHandlerBase, ITaskHandler
- Inheritance
-
objectGuiTaskHandlerBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Remarks
This class is thread-safe.
Fields
LogRtf
Aggregated Log entries in rich-text form.
protected readonly RtfBuilder LogRtf
Field Value
Properties
CredentialProvider
Used to ask the user or a keyring for System.Net.NetworkCredentials for specific System.Uris; can be null.
protected override ICredentialProvider CredentialProvider { get; }
Property Value
IsInteractive
Indicates whether the user can provide input.
protected override bool IsInteractive { get; }
Property Value
- bool
Methods
AskInteractive(string, bool)
Asks the user a Yes/No/Cancel question.
protected override bool AskInteractive(string question, bool defaultAnswer)
Parameters
questionstringThe question and comprehensive information to help the user make an informed decision.
defaultAnswerboolThe default answer to preselect.
Returns
- bool
trueif the user answered with 'Yes';falseif the user answered with 'No'.
Exceptions
- OperationCanceledException
Throw if the user answered with 'Cancel'.
DisplayLogEntry(LogSeverity, string)
protected override void DisplayLogEntry(LogSeverity severity, string message)
Parameters
severityLogSeveritymessagestring
Error(Exception)
Displays an error message to the user.
public override void Error(Exception exception)
Parameters
exceptionExceptionThe exception representing the error that occurred.
GetLogColor(LogSeverity)
Determines the color to use for a log entry based on the LogSeverity.
protected static RtfColor GetLogColor(LogSeverity severity)
Parameters
severityLogSeverity
Returns
Output(string, string)
Displays multi-line text to the user.
public override void Output(string title, string message)
Parameters
titlestringA title for the message.
messagestringThe string to display. Trailing linebreaks are appropriately handled or ignored.
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.
public override void Output<T>(string title, NamedCollection<T> data) where T : INamed
Parameters
titlestringA title for the data.INamed
dataNamedCollection<T>The data to display.
Type Parameters
T
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.
public override void Output<T>(string title, IEnumerable<T> data)
Parameters
titlestringA title for the data.
dataIEnumerable<T>The data to display.
Type Parameters
T
Remarks
Implementations may close the UI as a side effect. Therefore this should be your last call on the handler.