Class DelegateHelpers
Represents various extensions of delegates.
Inherited Members
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public static class DelegateHelpers
Methods
| Edit this page View SourceBind<T>(Action<T>, T)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Action Bind<T>(this Action<T> action, T obj) where T : class
Parameters
Type | Name | Description |
---|---|---|
Action<T> | action | The action to bind. |
T | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Action | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T | The type of the first parameter to bind. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T>(Predicate<T>, T)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Func<bool> Bind<T>(this Predicate<T> predicate, T obj) where T : class
Parameters
Type | Name | Description |
---|---|---|
Predicate<T> | predicate | The predicate to bind. |
T | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Func<bool> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T | The type of the first parameter to bind. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T1, T2>(Action<T1, T2>, T1)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Action<T2> Bind<T1, T2>(this Action<T1, T2> action, T1 obj) where T1 : class
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2> | action | The action to bind. |
T1 | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Action<T2> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter to bind. |
T2 | The type of the second parameter. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T, TResult>(Func<T, TResult>, T)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Func<TResult> Bind<T, TResult>(this Func<T, TResult> func, T obj) where T : class
Parameters
Type | Name | Description |
---|---|---|
Func<T, TResult> | func | The action to bind. |
T | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Func<TResult> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T | The type of the first parameter to bind. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T1, T2, T3>(Action<T1, T2, T3>, T1)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Action<T2, T3> Bind<T1, T2, T3>(this Action<T1, T2, T3> action, T1 obj) where T1 : class
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2, T3> | action | The action to bind. |
T1 | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Action<T2, T3> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter to bind. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T1, T2, TResult>(Func<T1, T2, TResult>, T1)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Func<T2, TResult> Bind<T1, T2, TResult>(this Func<T1, T2, TResult> func, T1 obj) where T1 : class
Parameters
Type | Name | Description |
---|---|---|
Func<T1, T2, TResult> | func | The action to bind. |
T1 | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Func<T2, TResult> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter to bind. |
T2 | The type of the second parameter. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T1, T2, T3, T4>(Action<T1, T2, T3, T4>, T1)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Action<T2, T3, T4> Bind<T1, T2, T3, T4>(this Action<T1, T2, T3, T4> action, T1 obj) where T1 : class
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2, T3, T4> | action | The action to bind. |
T1 | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Action<T2, T3, T4> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter to bind. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T1, T2, T3, TResult>(Func<T1, T2, T3, TResult>, T1)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Func<T2, T3, TResult> Bind<T1, T2, T3, TResult>(this Func<T1, T2, T3, TResult> func, T1 obj) where T1 : class
Parameters
Type | Name | Description |
---|---|---|
Func<T1, T2, T3, TResult> | func | The action to bind. |
T1 | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Func<T2, T3, TResult> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter to bind. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5>, T1)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Action<T2, T3, T4, T5> Bind<T1, T2, T3, T4, T5>(this Action<T1, T2, T3, T4, T5> action, T1 obj) where T1 : class
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2, T3, T4, T5> | action | The action to bind. |
T1 | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Action<T2, T3, T4, T5> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter to bind. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
T5 | The type of the fifth parameter. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, TResult>, T1)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Func<T2, T3, T4, TResult> Bind<T1, T2, T3, T4, TResult>(this Func<T1, T2, T3, T4, TResult> func, T1 obj) where T1 : class
Parameters
Type | Name | Description |
---|---|---|
Func<T1, T2, T3, T4, TResult> | func | The action to bind. |
T1 | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Func<T2, T3, T4, TResult> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter to bind. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Bind<T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, TResult>, T1)
Produces a delegate whose first parameter is implicitly bound to the given object.
Declaration
public static Func<T2, T3, T4, T5, TResult> Bind<T1, T2, T3, T4, T5, TResult>(this Func<T1, T2, T3, T4, T5, TResult> func, T1 obj) where T1 : class
Parameters
Type | Name | Description |
---|---|---|
Func<T1, T2, T3, T4, T5, TResult> | func | The action to bind. |
T1 | obj | The object to be passed implicitly as the first argument into the method represented by this pointer. Cannot be null. |
Returns
Type | Description |
---|---|
Func<T2, T3, T4, T5, TResult> | The delegate targeting the specified object. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first parameter to bind. |
T2 | The type of the second parameter. |
T3 | The type of the third parameter. |
T4 | The type of the fourth parameter. |
T5 | The type of the fifth parameter. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ChangeType<TDelegate>(Delegate)
Returns a new delegate of different type which points to the same method as original delegate.
Declaration
public static TDelegate ChangeType<TDelegate>(this Delegate d) where TDelegate : Delegate
Parameters
Type | Name | Description |
---|---|---|
Delegate | d | Delegate to convert. |
Returns
Type | Description |
---|---|
TDelegate | A method wrapped into new delegate type. |
Type Parameters
Name | Description |
---|---|
TDelegate | A new delegate type. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Cannot convert delegate type. |
Contravariant<TBase, T>(EventHandler<TBase>)
Performs contravariant conversion of actual generic argument specified for EventHandler<TEventArgs> type.
Declaration
public static EventHandler<T> Contravariant<TBase, T>(this EventHandler<TBase> handler) where TBase : class where T : class, TBase
Parameters
Type | Name | Description |
---|---|---|
EventHandler<TBase> | handler | The handler to convert. |
Returns
Type | Description |
---|---|
EventHandler<T> | The delegate referencing the same method as original delegate. |
Type Parameters
Name | Description |
---|---|
TBase | Input type of the delegate. |
T | A subtype of |
Remarks
Generic parameter of delegate EventHandler<TEventArgs> is not marked as in so compiler doesn't support contravariant conversion for it. This method provides contravariant conversion for this delegate type.
CreateClosedDelegateFactory<TDelegate>(Expression<TDelegate>)
Creates a factory for closed delegates.
Declaration
public static Func<object, TDelegate> CreateClosedDelegateFactory<TDelegate>(Expression<TDelegate> expression) where TDelegate : Delegate
Parameters
Type | Name | Description |
---|---|---|
Expression<TDelegate> | expression | The expression tree containing instance method, property, operator call. |
Returns
Type | Description |
---|---|
Func<object, TDelegate> | The factory of closed delegate. |
Type Parameters
Name | Description |
---|---|
TDelegate | The type of the delegate describing expression tree. |
CreateDelegate(delegate*<void>)
Converts static method represented by the pointer to the open delegate of type Action.
Declaration
[CLSCompliant(false)]
public static Action CreateDelegate(delegate*<void> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<void> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Action | The delegate instance. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<TResult>(delegate*<TResult>)
Converts static method represented by the pointer to the open delegate of type Func<TResult>.
Declaration
[CLSCompliant(false)]
public static Func<TResult> CreateDelegate<TResult>(delegate*<TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<TResult>(delegate*<TResult>)
Converts static method represented by the pointer to the open delegate of type Func<TResult>.
Declaration
[CLSCompliant(false)]
public static Func<TResult> CreateDelegate<TResult>(delegate*<TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T>(delegate*<T, void>, T)
Converts static method represented by the pointer to the closed delegate of type Action.
Declaration
[CLSCompliant(false)]
public static Action CreateDelegate<T>(delegate*<T, void> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, void> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Action | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void>)
Converts static method represented by the pointer to the open delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<T, TArg> CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<Span<T>, TArg, void> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
SpanAction<T, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void>)
Converts static method represented by the pointer to the open delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<T, TArg> CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<Span<T>, TArg, void> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
SpanAction<T, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void>)
Converts static method represented by the pointer to the open delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<T, TArg> CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<Span<T>, TArg, void> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
SpanAction<T, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void>)
Converts static method represented by the pointer to the open delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<T, TArg> CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<Span<T>, TArg, void> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
SpanAction<T, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void>)
Converts static method represented by the pointer to the open delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<T, TArg> CreateDelegate<T, TArg>(delegate*<Span<T>, TArg, void> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<Span<T>, TArg, void> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
SpanAction<T, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TResult>(delegate*<T, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<TResult>.
Declaration
[CLSCompliant(false)]
public static Func<TResult> CreateDelegate<T, TResult>(delegate*<T, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TResult>(delegate*<T, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<TResult>.
Declaration
[CLSCompliant(false)]
public static Func<TResult> CreateDelegate<T, TResult>(delegate*<T, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, TResult>(delegate*<T1, T2, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, TResult> CreateDelegate<T1, T2, TResult>(delegate*<T1, T2, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, TResult>(delegate*<T1, T2, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, TResult> CreateDelegate<T1, T2, TResult>(delegate*<T1, T2, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, TResult>(delegate*<T1, T2, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, TResult> CreateDelegate<T1, T2, TResult>(delegate*<T1, T2, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void>, T)
Converts static method represented by the pointer to the closed delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<TItem, TArg> CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, Span<TItem>, TArg, void> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
SpanAction<TItem, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
TItem | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void>, T)
Converts static method represented by the pointer to the closed delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<TItem, TArg> CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, Span<TItem>, TArg, void> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
SpanAction<TItem, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
TItem | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void>, T)
Converts static method represented by the pointer to the closed delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<TItem, TArg> CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, Span<TItem>, TArg, void> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
SpanAction<TItem, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
TItem | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void>, T)
Converts static method represented by the pointer to the closed delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<TItem, TArg> CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, Span<TItem>, TArg, void> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
SpanAction<TItem, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
TItem | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void>, T)
Converts static method represented by the pointer to the closed delegate of type SpanAction<T, TArg>.
Declaration
[CLSCompliant(false)]
public static SpanAction<TItem, TArg> CreateDelegate<T, TItem, TArg>(delegate*<T, Span<TItem>, TArg, void> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, Span<TItem>, TArg, void> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
SpanAction<TItem, TArg> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
TItem | The type of the objects in the read-only span. |
TArg | The type of the object that represents the state. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, T3, TResult>(delegate*<T1, T2, T3, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, T3, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, TResult> CreateDelegate<T1, T2, T3, TResult>(delegate*<T1, T2, T3, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, T3, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, T3, TResult>(delegate*<T1, T2, T3, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, T3, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, TResult> CreateDelegate<T1, T2, T3, TResult>(delegate*<T1, T2, T3, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, T3, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, TResult>(delegate*<T, T1, T2, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, TResult> CreateDelegate<T, T1, T2, TResult>(delegate*<T, T1, T2, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, TResult>(delegate*<T, T1, T2, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, TResult> CreateDelegate<T, T1, T2, TResult>(delegate*<T, T1, T2, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, TResult>(delegate*<T, T1, T2, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, TResult> CreateDelegate<T, T1, T2, TResult>(delegate*<T, T1, T2, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, T3, T4, TResult>(delegate*<T1, T2, T3, T4, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, T3, T4, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, TResult> CreateDelegate<T1, T2, T3, T4, TResult>(delegate*<T1, T2, T3, T4, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, T3, T4, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, T3, T4, TResult>(delegate*<T1, T2, T3, T4, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, T3, T4, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, TResult> CreateDelegate<T1, T2, T3, T4, TResult>(delegate*<T1, T2, T3, T4, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, T3, T4, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, T3, TResult>(delegate*<T, T1, T2, T3, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, T3, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, TResult> CreateDelegate<T, T1, T2, T3, TResult>(delegate*<T, T1, T2, T3, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, T3, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, T3, TResult>(delegate*<T, T1, T2, T3, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, T3, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, TResult> CreateDelegate<T, T1, T2, T3, TResult>(delegate*<T, T1, T2, T3, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, T3, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, T3, T4, T5, TResult>(delegate*<T1, T2, T3, T4, T5, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, T3, T4, T5, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, T5, TResult> CreateDelegate<T1, T2, T3, T4, T5, TResult>(delegate*<T1, T2, T3, T4, T5, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, T3, T4, T5, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, T5, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, T3, T4, T5, TResult>(delegate*<T1, T2, T3, T4, T5, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, T3, T4, T5, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, T5, TResult> CreateDelegate<T1, T2, T3, T4, T5, TResult>(delegate*<T1, T2, T3, T4, T5, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, T3, T4, T5, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, T5, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, T3, T4, TResult>(delegate*<T, T1, T2, T3, T4, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, T3, T4, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, TResult> CreateDelegate<T, T1, T2, T3, T4, TResult>(delegate*<T, T1, T2, T3, T4, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, T3, T4, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, T3, T4, TResult>(delegate*<T, T1, T2, T3, T4, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, T3, T4, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, TResult> CreateDelegate<T, T1, T2, T3, T4, TResult>(delegate*<T, T1, T2, T3, T4, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, T3, T4, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T1, T2, T3, T4, T5, T6, TResult>(delegate*<T1, T2, T3, T4, T5, T6, TResult>)
Converts static method represented by the pointer to the open delegate of type Func<T1, T2, T3, T4, T5, T6, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, T5, T6, TResult> CreateDelegate<T1, T2, T3, T4, T5, T6, TResult>(delegate*<T1, T2, T3, T4, T5, T6, TResult> ptr)
Parameters
Type | Name | Description |
---|---|---|
delegate*<T1, T2, T3, T4, T5, T6, TResult> | ptr | The function pointer. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, T5, T6, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, T3, T4, T5, TResult>(delegate*<T, T1, T2, T3, T4, T5, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, T3, T4, T5, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, T5, TResult> CreateDelegate<T, T1, T2, T3, T4, T5, TResult>(delegate*<T, T1, T2, T3, T4, T5, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, T3, T4, T5, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, T5, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, T3, T4, T5, TResult>(delegate*<T, T1, T2, T3, T4, T5, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, T3, T4, T5, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, T5, TResult> CreateDelegate<T, T1, T2, T3, T4, T5, TResult>(delegate*<T, T1, T2, T3, T4, T5, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, T3, T4, T5, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, T5, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateDelegate<T, T1, T2, T3, T4, T5, T6, TResult>(delegate*<T, T1, T2, T3, T4, T5, T6, TResult>, T)
Converts static method represented by the pointer to the closed delegate of type Func<T1, T2, T3, T4, T5, T6, TResult>.
Declaration
[CLSCompliant(false)]
public static Func<T1, T2, T3, T4, T5, T6, TResult> CreateDelegate<T, T1, T2, T3, T4, T5, T6, TResult>(delegate*<T, T1, T2, T3, T4, T5, T6, TResult> ptr, T obj) where T : class?
Parameters
Type | Name | Description |
---|---|---|
delegate*<T, T1, T2, T3, T4, T5, T6, TResult> | ptr | The function pointer. |
T | obj | The object to be passed as first argument implicitly. |
Returns
Type | Description |
---|---|
Func<T1, T2, T3, T4, T5, T6, TResult> | The delegate instance. |
Type Parameters
Name | Description |
---|---|
T | The type of the implicit capture object. |
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CreateOpenDelegate<TDelegate>(Expression<TDelegate>)
Creates open delegate for the instance method, property, operator referenced in expression tree.
Declaration
public static TDelegate CreateOpenDelegate<TDelegate>(Expression<TDelegate> expression) where TDelegate : Delegate
Parameters
Type | Name | Description |
---|---|---|
Expression<TDelegate> | expression | The expression tree containing instance method call. |
Returns
Type | Description |
---|---|
TDelegate | The open delegate. |
Type Parameters
Name | Description |
---|---|
TDelegate | The type of the delegate describing expression tree. |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
CreateOpenDelegate<T, TValue>(Expression<Func<T, TValue>>)
Creates open delegate for instance property setter.
Declaration
public static Action<T, TValue> CreateOpenDelegate<T, TValue>(Expression<Func<T, TValue>> properyExpr) where T : class
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<T, TValue>> | properyExpr | The expression representing property. |
Returns
Type | Description |
---|---|
Action<T, TValue> | The open delegate representing property setter. |
Type Parameters
Name | Description |
---|---|
T | The declaring type. |
TValue | The type of property value. |
HideReturnValue<TResult>(Func<TResult>)
Creates a delegate that hides the return value.
Declaration
public static Action HideReturnValue<TResult>(this Func<TResult> func)
Parameters
Type | Name | Description |
---|---|---|
Func<TResult> | func | The function. |
Returns
Type | Description |
---|---|
Action | The action that invokes the same method as |
Type Parameters
Name | Description |
---|---|
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
HideReturnValue<T, TResult>(Func<T, TResult>)
Creates a delegate that hides the return value.
Declaration
public static Action<T> HideReturnValue<T, TResult>(this Func<T, TResult> func)
Parameters
Type | Name | Description |
---|---|---|
Func<T, TResult> | func | The function. |
Returns
Type | Description |
---|---|
Action<T> | The action that invokes the same method as |
Type Parameters
Name | Description |
---|---|
T | The type of the argument to be passed to the action. |
TResult | The type of the result. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync(Action)
Converts action to async delegate.
Declaration
public static Func<CancellationToken, ValueTask> ToAsync(this Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | Synchronous action. |
Returns
Type | Description |
---|---|
Func<CancellationToken, ValueTask> | The asynchronous function that wraps |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<T>(Action<T>)
Converts action to async delegate.
Declaration
public static Func<T, CancellationToken, ValueTask> ToAsync<T>(this Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
Action<T> | action | Synchronous action. |
Returns
Type | Description |
---|---|
Func<T, CancellationToken, ValueTask> | The asynchronous function that wraps |
Type Parameters
Name | Description |
---|---|
T | The type of the argument to be passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<TResult>(Func<TResult>)
Converts function to async delegate.
Declaration
public static Func<CancellationToken, ValueTask<TResult>> ToAsync<TResult>(this Func<TResult> func)
Parameters
Type | Name | Description |
---|---|---|
Func<TResult> | func | Synchronous function. |
Returns
Type | Description |
---|---|
Func<CancellationToken, ValueTask<TResult>> | The asynchronous function that wraps |
Type Parameters
Name | Description |
---|---|
TResult | The type of the return value. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<T1, T2>(Action<T1, T2>)
Converts action to async delegate.
Declaration
public static Func<T1, T2, CancellationToken, ValueTask> ToAsync<T1, T2>(this Action<T1, T2> action)
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2> | action | Synchronous action. |
Returns
Type | Description |
---|---|
Func<T1, T2, CancellationToken, ValueTask> | The asynchronous function that wraps |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument to be passed to the action. |
T2 | The type of the second argument to be passed to the action. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<T, TResult>(Func<T, TResult>)
Converts function to async delegate.
Declaration
public static Func<T, CancellationToken, ValueTask<TResult>> ToAsync<T, TResult>(this Func<T, TResult> action)
Parameters
Type | Name | Description |
---|---|---|
Func<T, TResult> | action | Synchronous function. |
Returns
Type | Description |
---|---|
Func<T, CancellationToken, ValueTask<TResult>> | The asynchronous function that wraps |
Type Parameters
Name | Description |
---|---|
T | The type of the argument to be passed to the action. |
TResult | The type of the return value. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToAsync<T1, T2, TResult>(Func<T1, T2, TResult>)
Converts function to async delegate.
Declaration
public static Func<T1, T2, CancellationToken, ValueTask<TResult>> ToAsync<T1, T2, TResult>(this Func<T1, T2, TResult> func)
Parameters
Type | Name | Description |
---|---|---|
Func<T1, T2, TResult> | func | Synchronous action. |
Returns
Type | Description |
---|---|
Func<T1, T2, CancellationToken, ValueTask<TResult>> | The asynchronous function that wraps |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument to be passed to the action. |
T2 | The type of the second argument to be passed to the action. |
TResult | The type of the return value. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Unbind<T>(Action)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Action<T> Unbind<T>(this Action action) where T : class
Parameters
Type | Name | Description |
---|---|---|
Action | action | The delegate to unbind. |
Returns
Type | Description |
---|---|
Action<T> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T>(Func<bool>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Predicate<T> Unbind<T>(this Func<bool> func) where T : class
Parameters
Type | Name | Description |
---|---|---|
Func<bool> | func | The delegate to unbind. |
Returns
Type | Description |
---|---|
Predicate<T> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, TArg>(Action<TArg>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Action<T, TArg> Unbind<T, TArg>(this Action<TArg> action) where T : class
Parameters
Type | Name | Description |
---|---|---|
Action<TArg> | action | The delegate to unbind. |
Returns
Type | Description |
---|---|
Action<T, TArg> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
TArg | The type of the first explicit parameter. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, TResult>(Func<TResult>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Func<T, TResult> Unbind<T, TResult>(this Func<TResult> func) where T : class
Parameters
Type | Name | Description |
---|---|---|
Func<TResult> | func | The delegate to unbind. |
Returns
Type | Description |
---|---|
Func<T, TResult> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, T1, T2>(Action<T1, T2>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Action<T, T1, T2> Unbind<T, T1, T2>(this Action<T1, T2> action) where T : class
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2> | action | The delegate to unbind. |
Returns
Type | Description |
---|---|
Action<T, T1, T2> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
T1 | The type of the first explicit parameter. |
T2 | The type of the second explicit parameter. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, TArg, TResult>(Func<TArg, TResult>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Func<T, TArg, TResult> Unbind<T, TArg, TResult>(this Func<TArg, TResult> func) where T : class
Parameters
Type | Name | Description |
---|---|---|
Func<TArg, TResult> | func | The delegate to unbind. |
Returns
Type | Description |
---|---|
Func<T, TArg, TResult> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
TArg | The type of the first explicit parameter. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, T1, T2, T3>(Action<T1, T2, T3>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Action<T, T1, T2, T3> Unbind<T, T1, T2, T3>(this Action<T1, T2, T3> action) where T : class
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2, T3> | action | The delegate to unbind. |
Returns
Type | Description |
---|---|
Action<T, T1, T2, T3> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
T1 | The type of the first explicit parameter. |
T2 | The type of the second explicit parameter. |
T3 | The type of the third explicit parameter. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, T1, T2, TResult>(Func<T1, T2, TResult>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Func<T, T1, T2, TResult> Unbind<T, T1, T2, TResult>(this Func<T1, T2, TResult> func) where T : class
Parameters
Type | Name | Description |
---|---|---|
Func<T1, T2, TResult> | func | The delegate to unbind. |
Returns
Type | Description |
---|---|
Func<T, T1, T2, TResult> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
T1 | The type of the first explicit parameter. |
T2 | The type of the second explicit parameter. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, T1, T2, T3, T4>(Action<T1, T2, T3, T4>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Action<T, T1, T2, T3, T4> Unbind<T, T1, T2, T3, T4>(this Action<T1, T2, T3, T4> action) where T : class
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2, T3, T4> | action | The delegate to unbind. |
Returns
Type | Description |
---|---|
Action<T, T1, T2, T3, T4> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
T1 | The type of the first explicit parameter. |
T2 | The type of the second explicit parameter. |
T3 | The type of the third explicit parameter. |
T4 | The type of the fourth explicit parameter. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, T1, T2, T3, TResult>(Func<T1, T2, T3, TResult>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Func<T, T1, T2, T3, TResult> Unbind<T, T1, T2, T3, TResult>(this Func<T1, T2, T3, TResult> func) where T : class
Parameters
Type | Name | Description |
---|---|---|
Func<T1, T2, T3, TResult> | func | The delegate to unbind. |
Returns
Type | Description |
---|---|
Func<T, T1, T2, T3, TResult> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
T1 | The type of the first explicit parameter. |
T2 | The type of the second explicit parameter. |
T3 | The type of the third explicit parameter. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Action<T, T1, T2, T3, T4, T5> Unbind<T, T1, T2, T3, T4, T5>(this Action<T1, T2, T3, T4, T5> action) where T : class
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2, T3, T4, T5> | action | The delegate to unbind. |
Returns
Type | Description |
---|---|
Action<T, T1, T2, T3, T4, T5> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
T1 | The type of the first explicit parameter. |
T2 | The type of the second explicit parameter. |
T3 | The type of the third explicit parameter. |
T4 | The type of the fourth explicit parameter. |
T5 | The type of the fifth explicit parameter. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, T1, T2, T3, T4, TResult>(Func<T1, T2, T3, T4, TResult>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Func<T, T1, T2, T3, T4, TResult> Unbind<T, T1, T2, T3, T4, TResult>(this Func<T1, T2, T3, T4, TResult> func) where T : class
Parameters
Type | Name | Description |
---|---|---|
Func<T1, T2, T3, T4, TResult> | func | The delegate to unbind. |
Returns
Type | Description |
---|---|
Func<T, T1, T2, T3, T4, TResult> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
T1 | The type of the first explicit parameter. |
T2 | The type of the second explicit parameter. |
T3 | The type of the third explicit parameter. |
T4 | The type of the fourth explicit parameter. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |
Unbind<T, T1, T2, T3, T4, T5, TResult>(Func<T1, T2, T3, T4, T5, TResult>)
Converts implicitly bound delegate into its unbound version.
Declaration
public static Func<T, T1, T2, T3, T4, T5, TResult> Unbind<T, T1, T2, T3, T4, T5, TResult>(this Func<T1, T2, T3, T4, T5, TResult> func) where T : class
Parameters
Type | Name | Description |
---|---|---|
Func<T1, T2, T3, T4, T5, TResult> | func | The delegate to unbind. |
Returns
Type | Description |
---|---|
Func<T, T1, T2, T3, T4, T5, TResult> | Unbound version of the delegate. |
Type Parameters
Name | Description |
---|---|
T | The expected type of Target. |
T1 | The type of the first explicit parameter. |
T2 | The type of the second explicit parameter. |
T3 | The type of the third explicit parameter. |
T4 | The type of the fourth explicit parameter. |
T5 | The type of the fifth explicit parameter. |
TResult | The type of the return value of the method that the delegate encapsulates. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Target of |