Struct ValueAction<T1, T2, T3, T4>
Represents a pointer to the method with fourth parameters and
Namespace: DotNext
Assembly: DotNext.dll
Syntax
public struct ValueAction<T1, T2, T3, T4> : ICallable<Action<T1, T2, T3, T4>>, ICallable, IEquatable<ValueAction<T1, T2, T3, T4>>
Type Parameters
Name | Description |
---|---|
T1 | The type of the first method parameter. |
T2 | The type of the second method parameter. |
T3 | The type of the third method parameter. |
T4 | The type of the fourth method parameter. |
Remarks
This method pointer is intended to call managed methods only.
Constructors
| Improve this Doc View SourceValueAction(Action<T1, T2, T3, T4>, Boolean)
Initializes a new pointer based on extracted pointer from the delegate.
Declaration
public ValueAction(Action<T1, T2, T3, T4> action, bool wrap = false)
Parameters
Type | Name | Description |
---|---|---|
Action<T1, T2, T3, T4> | action | The delegate representing method. |
Boolean | wrap | true to wrap |
Remarks
You can use this constructor to create value delegate once and cache it using static readonly
field
for subsequent calls.
ValueAction(IntPtr)
Initializes a new delegate using pointer to the static managed method.
Declaration
public ValueAction(IntPtr methodPtr)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | methodPtr | The pointer to the static managed method. |
ValueAction(MethodInfo)
Initializes a new pointer to the method.
Declaration
public ValueAction(MethodInfo method)
Parameters
Type | Name | Description |
---|---|---|
MethodInfo | method | The method to convert into pointer. |
Remarks
This constructor causes heap allocations because Reflection is needed to check compatibility of method's signature with the delegate type.
Properties
| Improve this Doc View SourceIsEmpty
Indicates that this delegate doesn't refer to any method.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
Boolean |
Target
Gets the object on which the current pointer invokes the method.
Declaration
public object Target { get; }
Property Value
Type | Description |
---|---|
Object |
Methods
| Improve this Doc View SourceEquals(ValueAction<T1, T2, T3, T4>)
Determines whether this object points to the same method as other object.
Declaration
public bool Equals(ValueAction<T1, T2, T3, T4> other)
Parameters
Type | Name | Description |
---|---|---|
ValueAction<T1, T2, T3, T4> | other | The pointer to compare. |
Returns
Type | Description |
---|---|
Boolean | true if both pointers represent the same method; otherwise, false. |
Equals(Object)
Determines whether this object points to the same method as other object.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
Object | other | The object implementing ICallable<D> to compare. |
Returns
Type | Description |
---|---|
Boolean | true if both pointers represent the same method; otherwise, false. |
GetHashCode()
Computes hash code of this pointer.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The hash code of this pointer. |
Invoke(T1, T2, T3, T4)
Invokes method by pointer.
Declaration
public void Invoke(T1 arg1, T2 arg2, T3 arg3, T4 arg4)
Parameters
Type | Name | Description |
---|---|---|
T1 | arg1 | The first argument to be passed into the target method. |
T2 | arg2 | The second argument to be passed into the target method. |
T3 | arg3 | The third argument to be passed into the target method. |
T4 | arg4 | The fourth argument to be passed into the target method. |
ToDelegate()
Converts this pointer into
Declaration
public Action<T1, T2, T3, T4> ToDelegate()
Returns
Type | Description |
---|---|
Action<T1, T2, T3, T4> | The delegate created from this method pointer; or null if this pointer is zero. |
ToString()
Obtains pointer value in HEX format.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The address represented by pointer. |
Operators
| Improve this Doc View SourceEquality(ValueAction<T1, T2, T3, T4>, ValueAction<T1, T2, T3, T4>)
Determines whether the pointers represent the same method.
Declaration
public static bool operator ==(in ValueAction<T1, T2, T3, T4> first, in ValueAction<T1, T2, T3, T4> second)
Parameters
Type | Name | Description |
---|---|---|
ValueAction<T1, T2, T3, T4> | first | The first pointer to compare. |
ValueAction<T1, T2, T3, T4> | second | The second pointer to compare. |
Returns
Type | Description |
---|---|
Boolean | true if both pointers represent the same method; otherwise, false. |
Explicit(ValueAction<T1, T2, T3, T4> to Action<T1, T2, T3, T4>)
Converts this pointer into
Declaration
public static explicit operator Action<T1, T2, T3, T4>(in ValueAction<T1, T2, T3, T4> pointer)
Parameters
Type | Name | Description |
---|---|---|
ValueAction<T1, T2, T3, T4> | pointer | The pointer to convert. |
Returns
Type | Description |
---|---|
Action<T1, T2, T3, T4> | The delegate created from this method pointer. |
Inequality(ValueAction<T1, T2, T3, T4>, ValueAction<T1, T2, T3, T4>)
Determines whether the pointers represent different methods.
Declaration
public static bool operator !=(in ValueAction<T1, T2, T3, T4> first, in ValueAction<T1, T2, T3, T4> second)
Parameters
Type | Name | Description |
---|---|---|
ValueAction<T1, T2, T3, T4> | first | The first pointer to compare. |
ValueAction<T1, T2, T3, T4> | second | The second pointer to compare. |
Returns
Type | Description |
---|---|
Boolean | true if both pointers represent different methods; otherwise, false. |
Explicit Interface Implementations
| Improve this Doc View SourceICallable.DynamicInvoke(Object[])
Declaration
object ICallable.DynamicInvoke(params object[] args)
Parameters
Type | Name | Description |
---|---|---|
Object[] | args |
Returns
Type | Description |
---|---|
Object |