Class TesterFuncUtility
This utility class is designed to handle those rare scenarios where you have knowledge about potential exceptions that can be safely ignored.
Inheritance
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class TesterFuncUtility
Methods
| Improve this DocTryExecuteAction(Action)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteAction(Action method)
Parameters
Type | Name | Description |
---|---|---|
System.Action | method | The delegate to invoke. |
Returns
Type | Description |
---|---|
System.Boolean |
|
TryExecuteAction<T>(Action<T>, T)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteAction<T>(Action<T> method, T arg)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | method | The delegate to invoke. |
T | arg | The first parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T | The type of the parameter of the method. |
TryExecuteAction<T1, T2>(Action<T1, T2>, T1, T2)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteAction<T1, T2>(Action<T1, T2> method, T1 arg1, T2 arg2)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2> | method | The delegate to invoke. |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
TryExecuteAction<T1, T2, T3>(Action<T1, T2, T3>, T1, T2, T3)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteAction<T1, T2, T3>(Action<T1, T2, T3> method, T1 arg1, T2 arg2, T3 arg3)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3> | method | The delegate to invoke. |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
T3 | arg3 | The third parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
T3 | The type of the third parameter of the method. |
TryExecuteAction<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1, T2, T3, T4)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteAction<T1, T2, T3, T4>(Action<T1, T2, T3, T4> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4> | method | The delegate to invoke. |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
T3 | arg3 | The third parameter of the |
T4 | arg4 | The fourth parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
T3 | The type of the third parameter of the method. |
T4 | The type of the fourth parameter of the method. |
TryExecuteAction<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5>, T1, T2, T3, T4, T5)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteAction<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T1, T2, T3, T4, T5> | method | The delegate to invoke. |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
T3 | arg3 | The third parameter of the |
T4 | arg4 | The fourth parameter of the |
T5 | arg5 | The fifth parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
T3 | The type of the third parameter of the method. |
T4 | The type of the fourth parameter of the method. |
T5 | The type of the fifth parameter of the method. |
TryExecuteFunction<TResult>(Func<TResult>, out TResult)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteFunction<TResult>(Func<TResult> method, out TResult result)
Parameters
Type | Name | Description |
---|---|---|
System.Func<TResult> | method | The function delegate to invoke to try and get the |
TResult | result | When this method returns, contains the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
TResult | The type of the return value of the method. |
TryExecuteFunction<T, TResult>(Func<T, TResult>, T)
Returns a value that indicates whether the specified method
was invoked without an exception.
Declaration
public static bool TryExecuteFunction<T, TResult>(Func<T, TResult> method, T arg)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult> | method | The function delegate to invoke. |
T | arg | The parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T | The type of the parameter of the method. |
TResult | The type of the return value of the method that you explicitly have chosen to ignore. |
TryExecuteFunction<T, TResult>(Func<T, TResult>, T, out TResult)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteFunction<T, TResult>(Func<T, TResult> method, T arg, out TResult result)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult> | method | The function delegate to invoke to try and get the |
T | arg | The first parameter of the |
TResult | result | When this method returns, contains the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T | The type of the first parameter of the method. |
TResult | The type of the return value of the method. |
TryExecuteFunction<T1, T2, TResult>(Func<T1, T2, TResult>, T1, T2)
Returns a value that indicates whether the specified method
was invoked without an exception.
Declaration
public static bool TryExecuteFunction<T1, T2, TResult>(Func<T1, T2, TResult> method, T1 arg1, T2 arg2)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T1, T2, TResult> | method | The function delegate to invoke. |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
TResult | The type of the return value of the method that you explicitly have chosen to ignore. |
TryExecuteFunction<T1, T2, TResult>(Func<T1, T2, TResult>, T1, T2, out TResult)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteFunction<T1, T2, TResult>(Func<T1, T2, TResult> method, T1 arg1, T2 arg2, out TResult result)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T1, T2, TResult> | method | The function delegate to invoke to try and get the |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
TResult | result | When this method returns, contains the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
TResult | The type of the return value of the method. |
TryExecuteFunction<T1, T2, T3, TResult>(Func<T1, T2, T3, TResult>, T1, T2, T3)
Returns a value that indicates whether the specified method
was invoked without an exception.
Declaration
public static bool TryExecuteFunction<T1, T2, T3, TResult>(Func<T1, T2, T3, TResult> method, T1 arg1, T2 arg2, T3 arg3)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T1, T2, T3, TResult> | method | The function delegate to invoke. |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
T3 | arg3 | The third parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
T3 | The type of the third parameter of the method. |
TResult | The type of the return value of the method that you explicitly have chosen to ignore. |
TryExecuteFunction<T1, T2, T3, TResult>(Func<T1, T2, T3, TResult>, T1, T2, T3, out TResult)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteFunction<T1, T2, T3, TResult>(Func<T1, T2, T3, TResult> method, T1 arg1, T2 arg2, T3 arg3, out TResult result)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T1, T2, T3, TResult> | method | The function delegate to invoke to try and get the |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
T3 | arg3 | The third parameter of the |
TResult | result | When this method returns, contains the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
T3 | The type of the third parameter of the method. |
TResult | The type of the return value of the method. |
TryExecuteFunction<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, TResult>, T1, T2, T3, T4)
Returns a value that indicates whether the specified method
was invoked without an exception.
Declaration
public static bool TryExecuteFunction<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, TResult> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T1, T2, T3, T4, TResult> | method | The function delegate to invoke. |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
T3 | arg3 | The third parameter of the |
T4 | arg4 | The fourth parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
T3 | The type of the third parameter of the method. |
T4 | The type of the fourth parameter of the method. |
TResult | The type of the return value of the method that you explicitly have chosen to ignore. |
TryExecuteFunction<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, TResult>, T1, T2, T3, T4, out TResult)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteFunction<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, TResult> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, out TResult result)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T1, T2, T3, T4, TResult> | method | The function delegate to invoke to try and get the |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
T3 | arg3 | The third parameter of the |
T4 | arg4 | The fourth parameter of the |
TResult | result | When this method returns, contains the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
T3 | The type of the third parameter of the method. |
T4 | The type of the fourth parameter of the method. |
TResult | The type of the return value of the method. |
TryExecuteFunction<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5)
Returns a value that indicates whether the specified method
was invoked without an exception.
Declaration
public static bool TryExecuteFunction<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, TResult> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T1, T2, T3, T4, T5, TResult> | method | The function delegate to invoke. |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
T3 | arg3 | The third parameter of the |
T4 | arg4 | The fourth parameter of the |
T5 | arg5 | The fifth parameter of the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
T3 | The type of the third parameter of the method. |
T4 | The type of the fourth parameter of the method. |
T5 | The type of the fifth parameter of the method. |
TResult | The type of the return value of the method that you explicitly have chosen to ignore. |
TryExecuteFunction<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5, out TResult)
Returns a value that indicates whether the specified method
can be invoked without an exception.
Declaration
public static bool TryExecuteFunction<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, TResult> method, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, out TResult result)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T1, T2, T3, T4, T5, TResult> | method | The function delegate to invoke to try and get the |
T1 | arg1 | The first parameter of the |
T2 | arg2 | The second parameter of the |
T3 | arg3 | The third parameter of the |
T4 | arg4 | The fourth parameter of the |
T5 | arg5 | The fifth parameter of the |
TResult | result | When this method returns, contains the |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter of the method. |
T2 | The type of the second parameter of the method. |
T3 | The type of the third parameter of the method. |
T4 | The type of the fourth parameter of the method. |
T5 | The type of the fifth parameter of the method. |
TResult | The type of the return value of the method. |