Class ExtensionMethods
Namespace: Monai.Deploy.InformaticsGateway.Common
Assembly: Monai.Deploy.InformaticsGateway.Common.dll
Syntax
public static class ExtensionMethods
Methods
| Improve this Doc View SourceIsCanceledOrFaulted(Task)
Checks if a given task is faulted or cancelled.
Declaration
public static bool IsCanceledOrFaulted(this Task task)
Parameters
Type | Name | Description |
---|---|---|
Task | task | The task object |
Returns
Type | Description |
---|---|
Boolean | True if canceled or faulted. False otherwise. |
IsNullOrEmpty<T>(IEnumerable<T>)
Extension method for checking a IEnumerable collection is null or empty.
Declaration
public static bool IsNullOrEmpty<T>(this IEnumerable<T> enumerable)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | enumerable |
Returns
Type | Description |
---|---|
Boolean | true if null or empty; false otherwise. |
Type Parameters
Name | Description |
---|---|
T |
Post<TInput>(ActionBlock<TInput>, TInput, TimeSpan)
Extension for ActionBlock to delay post of an object to be processed.
Declaration
public static async Task<bool> Post<TInput>(this ActionBlock<TInput> actionBlock, TInput input, TimeSpan delay)
Parameters
Type | Name | Description |
---|---|---|
ActionBlock<TInput> | actionBlock | Instance of |
TInput | input | Object to be posted |
TimeSpan | delay | Time to wait before posting |
Returns
Type | Description |
---|---|
Task<Boolean> |
Type Parameters
Name | Description |
---|---|
TInput | Type of object to be post to the actio. block |
RemoveInvalidPathChars(String)
Removes characters that cannot be used in file paths.
Declaration
public static string RemoveInvalidPathChars(this string input)
Parameters
Type | Name | Description |
---|---|---|
String | input | string to be scanned |
Returns
Type | Description |
---|---|
String |
|