Class TaskHandlerExtensions
Extension methods for ITaskHandler
Namespace: NanoByte.Common.Tasks
Assembly: NanoByte.Common.dll
Syntax
public static class TaskHandlerExtensions : Object
Methods
OutputLow(ITaskHandler, String, String)
Declaration
public static void OutputLow(this ITaskHandler handler, string title, string message)
Parameters
Type | Name | Description |
---|---|---|
ITaskHandler | handler | The underlying ITaskHandler. |
String | title | A title for the message. |
String | message | The string to display. |
Remarks
Implementations may close the UI as a side effect. Therefore this should be your last call on the handler.
OutputLow<T>(ITaskHandler, String, NamedCollection<T>)
Declaration
public static void OutputLow<T>(this ITaskHandler handler, string title, NamedCollection<T> data)
where T : INamed
Parameters
Type | Name | Description |
---|---|---|
ITaskHandler | handler | The underlying ITaskHandler. |
String | title | A title for the data.INamed |
NamedCollection<T> | data | The data to display. |
Type Parameters
Name | Description |
---|---|
T |
Remarks
Implementations may close the UI as a side effect. Therefore this should be your last call on the handler.
OutputLow<T>(ITaskHandler, String, IEnumerable<T>)
Declaration
public static void OutputLow<T>(this ITaskHandler handler, string title, IEnumerable<T> data)
Parameters
Type | Name | Description |
---|---|---|
ITaskHandler | handler | The underlying ITaskHandler. |
String | title | A title for the data. |
IEnumerable<T> | data | The data to display. |
Type Parameters
Name | Description |
---|---|
T |
Remarks
Implementations may close the UI as a side effect. Therefore this should be your last call on the handler.
RunTaskAndReturn<T>(ITaskHandler, ResultTask<T>)
Runs an IResultTask<T> and returns it's result once it has been completed.
Declaration
public static T RunTaskAndReturn<T>(this ITaskHandler handler, ResultTask<T> task)
Parameters
Type | Name | Description |
---|---|---|
ITaskHandler | handler | The task handler. |
ResultTask<T> | task | The task to be run. (Run(CancellationToken, ICredentialProvider, IProgress<TaskSnapshot>) or equivalent is called on it.) |
Returns
Type | Description |
---|---|
T | The Result. |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
System.OperationCanceledException | The user canceled the task. |
IOException | The task ended with IOError. |
WebException | The task ended with WebError. |