Class ExtensionMethods
- Namespace
- Monai.Deploy.InformaticsGateway.Common
- Assembly
- Monai.Deploy.InformaticsGateway.Common.dll
public static class ExtensionMethods
- Inheritance
-
ExtensionMethods
Methods
IsCanceledOrFaulted(Task)
Checks if a given task is faulted or cancelled.
public static bool IsCanceledOrFaulted(this Task task)
Parameters
task
TaskThe task object
Returns
- bool
True if canceled or faulted. False otherwise.
IsNullOrEmpty<T>(IEnumerable<T>)
Extension method for checking a IEnumerable collection is null or empty.
public static bool IsNullOrEmpty<T>(this IEnumerable<T> enumerable)
Parameters
enumerable
IEnumerable<T>
Returns
- bool
true if null or empty; false otherwise.
Type Parameters
T
Post<TInput>(ActionBlock<TInput>, TInput, TimeSpan)
Extension for ActionBlock to delay post of an object to be processed.
public static Task<bool> Post<TInput>(this ActionBlock<TInput> actionBlock, TInput input, TimeSpan delay)
Parameters
actionBlock
ActionBlock<TInput>Instance of
ActionBlock
input
TInputObject to be posted
delay
TimeSpanTime to wait before posting
Returns
Type Parameters
TInput
Type of object to be post to the actio. block
RemoveInvalidPathChars(string)
Removes characters that cannot be used in file paths.
public static string RemoveInvalidPathChars(this string input)
Parameters
input
stringstring to be scanned
Returns
- string
input
with invalid path characters removed.